Skip to content

Commit 80c3f87

Browse files
committed
Merge branch 'AFOS/correct_data_export' PR #39
2 parents f1e580e + 199f027 commit 80c3f87

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Copyright (c) Cosmo Tech corporation.
22
# Licensed under the MIT license.
33

4-
__version__ = '0.8.1'
4+
__version__ = '0.8.2'

cosmotech/coal/cli/commands/api/tdl_send_files.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ def tdl_send_files(
208208
LOGGER.info("Sent all data found")
209209

210210
dataset_info.ingestion_status = "SUCCESS"
211+
dataset_info.twincache_status = "FULL"
211212

212213
api_ds.update_dataset(organization_id,
213214
dataset_id,

cosmotech/coal/cli/commands/store/dump_to_postgresql.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,11 @@ def dump_to_postgresql(
7878
replace: bool
7979
):
8080
"""Running this command will dump your store to a given postgresql database
81-
81+
8282
Tables names from the store will be prepended with table-prefix in target database
83-
83+
8484
The postgresql user must have USAGE granted on the schema for this script to work due to the use of the command `COPY FROM STDIN`
85-
85+
8686
You can simply give him that grant by running the command :
8787
`GRANT USAGE ON SCHEMA <schema> TO <username>`
8888
"""
@@ -105,7 +105,11 @@ def dump_to_postgresql(
105105
with conn.cursor() as curs:
106106
_s_time = perf_counter()
107107
target_table_name = f"{table_prefix}{table_name}"
108+
LOGGER.info(f" - [yellow]{target_table_name}[/]:")
108109
data = _s.get_table(table_name)
110+
if not len(data):
111+
LOGGER.info(f" -> [cyan bold]0[/] rows (skipping)")
112+
continue
109113
_dl_time = perf_counter()
110114
rows = curs.adbc_ingest(
111115
target_table_name,
@@ -114,7 +118,7 @@ def dump_to_postgresql(
114118
db_schema_name=postgres_schema)
115119
total_rows += rows
116120
_up_time = perf_counter()
117-
LOGGER.info(f" - [yellow]{target_table_name}[/] : [cyan bold]{rows}[/] rows")
121+
LOGGER.info(f" -> [cyan bold]{rows}[/] rows")
118122
LOGGER.debug(f" -> Load from datastore took [blue]{_dl_time - _s_time:0.3}s[/]")
119123
LOGGER.debug(f" -> Send to postgresql took [blue]{_up_time - _dl_time:0.3}s[/]")
120124
_process_end = perf_counter()

0 commit comments

Comments
 (0)