rdxz2-utill 0.1.0__tar.gz → 0.1.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rdxz2-utill might be problematic. Click here for more details.
- {rdxz2_utill-0.1.0/src/rdxz2_utill.egg-info → rdxz2_utill-0.1.2}/PKG-INFO +1 -1
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/pyproject.toml +1 -1
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2/src/rdxz2_utill.egg-info}/PKG-INFO +1 -1
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_bq.py +6 -4
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_gcs.py +1 -1
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/LICENSE +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/README.md +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/setup.cfg +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/rdxz2_utill.egg-info/SOURCES.txt +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/rdxz2_utill.egg-info/dependency_links.txt +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/rdxz2_utill.egg-info/entry_points.txt +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/rdxz2_utill.egg-info/requires.txt +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/rdxz2_utill.egg-info/top_level.txt +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/__init__.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/__init__.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/_bq.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/_conf.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/_enc.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/_main.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/_pg.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/cmd/utill.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_compare.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_const.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_csv.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_datetime.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_dict.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_encryption.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_env.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_file.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_input.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_json.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_mb.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_pg.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_queue.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_string.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_style.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_tunnel.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/my_xlsx.py +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/templates/mb.json +0 -0
- {rdxz2_utill-0.1.0 → rdxz2_utill-0.1.2}/src/utill/templates/pg.json +0 -0
|
@@ -178,7 +178,8 @@ class BQ():
|
|
|
178
178
|
schema_str = ',\n'.join([column['name'] for column in schema])
|
|
179
179
|
query_parts.append(f'(\n{schema_str}\n)')
|
|
180
180
|
if table_options:
|
|
181
|
-
|
|
181
|
+
table_options_str = ',\n'.join(table_options)
|
|
182
|
+
query_parts.append(f'OPTIONS (\n{table_options_str}\n)')
|
|
182
183
|
else:
|
|
183
184
|
logger.debug('Table not exist, constructing CREATE TABLE query ...')
|
|
184
185
|
query_parts = [
|
|
@@ -193,7 +194,8 @@ class BQ():
|
|
|
193
194
|
clustering_fields_str = ', '.join([f'`{field}`' for field in clustering_fields])
|
|
194
195
|
query_parts.append(f'CLUSTER BY {clustering_fields_str}')
|
|
195
196
|
if table_options:
|
|
196
|
-
|
|
197
|
+
table_options_str = ',\n'.join(table_options)
|
|
198
|
+
query_parts.append(f'OPTIONS (\n{table_options_str}\n)')
|
|
197
199
|
query_parts.append('AS')
|
|
198
200
|
query_parts.append(textwrap.dedent(query).strip())
|
|
199
201
|
|
|
@@ -397,7 +399,7 @@ class BQ():
|
|
|
397
399
|
for tmp_blobs in gcs.list_blobs(dst_gcs_prefix):
|
|
398
400
|
local_tmp_filepath = os.path.join(tmp_dirname, tmp_blobs.name.split('/')[-1])
|
|
399
401
|
gcs.download(tmp_blobs, local_tmp_filepath, move=True)
|
|
400
|
-
logger.debug(f'Downloaded {tmp_blobs.name} to {local_tmp_filepath}')
|
|
402
|
+
# logger.debug(f'Downloaded {tmp_blobs.name} to {local_tmp_filepath}')
|
|
401
403
|
local_tmp_filepaths.append(local_tmp_filepath)
|
|
402
404
|
|
|
403
405
|
# Combine downloaded files
|
|
@@ -433,7 +435,7 @@ class BQ():
|
|
|
433
435
|
for part in range(parts):
|
|
434
436
|
dst_filepath_part = f'{dst_filepath.removesuffix(".csv")}_{part + 1:06}.csv'
|
|
435
437
|
_export_download_combine(
|
|
436
|
-
f'SELECT * EXCEPT(_rn) FROM `{tmp_table_fqn_rn}` WHERE _rn BETWEEN {(part * csv_row_limit) + 1} AND {(part + 1) * csv_row_limit}',
|
|
438
|
+
f'SELECT * EXCEPT(_rn) FROM `{tmp_table_fqn_rn}` WHERE _rn BETWEEN {(part * csv_row_limit) + 1} AND {(part + 1) * csv_row_limit} ORDER BY _rn',
|
|
437
439
|
dst_gcs_prefix=gcs.build_tmp_dirpath(),
|
|
438
440
|
dst_filepath=dst_filepath_part,
|
|
439
441
|
)
|
|
@@ -16,7 +16,7 @@ class GCS:
|
|
|
16
16
|
|
|
17
17
|
self.client = storage.Client(project=project_id or envs.GCP_PROJECT_ID)
|
|
18
18
|
self.bucket = self.client.bucket(bucket or envs.GCS_BUCKET)
|
|
19
|
-
logger.debug(f'GCS client open, project: {self.client.project}')
|
|
19
|
+
logger.debug(f'GCS client open, project: {self.client.project}, bucket: {self.bucket.name}')
|
|
20
20
|
|
|
21
21
|
def get_blob(self, blobpath: str) -> storage.Blob:
|
|
22
22
|
return self.bucket.blob(blobpath)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|