Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CosmoTech_Acceleration_Library/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) Cosmo Tech corporation.
# Licensed under the MIT license.

__version__ = '0.8.1'
__version__ = '0.8.2'
1 change: 1 addition & 0 deletions cosmotech/coal/cli/commands/api/tdl_send_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def tdl_send_files(
LOGGER.info("Sent all data found")

dataset_info.ingestion_status = "SUCCESS"
dataset_info.twincache_status = "FULL"

api_ds.update_dataset(organization_id,
dataset_id,
Expand Down
12 changes: 8 additions & 4 deletions cosmotech/coal/cli/commands/store/dump_to_postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ def dump_to_postgresql(
replace: bool
):
"""Running this command will dump your store to a given postgresql database

Tables names from the store will be prepended with table-prefix in target database

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`

You can simply give him that grant by running the command :
`GRANT USAGE ON SCHEMA <schema> TO <username>`
"""
Expand All @@ -105,7 +105,11 @@ def dump_to_postgresql(
with conn.cursor() as curs:
_s_time = perf_counter()
target_table_name = f"{table_prefix}{table_name}"
LOGGER.info(f" - [yellow]{target_table_name}[/]:")
data = _s.get_table(table_name)
if not len(data):
LOGGER.info(f" -> [cyan bold]0[/] rows (skipping)")
continue
_dl_time = perf_counter()
rows = curs.adbc_ingest(
target_table_name,
Expand All @@ -114,7 +118,7 @@ def dump_to_postgresql(
db_schema_name=postgres_schema)
total_rows += rows
_up_time = perf_counter()
LOGGER.info(f" - [yellow]{target_table_name}[/] : [cyan bold]{rows}[/] rows")
LOGGER.info(f" -> [cyan bold]{rows}[/] rows")
LOGGER.debug(f" -> Load from datastore took [blue]{_dl_time - _s_time:0.3}s[/]")
LOGGER.debug(f" -> Send to postgresql took [blue]{_up_time - _dl_time:0.3}s[/]")
_process_end = perf_counter()
Expand Down
Loading