cosmotech-acceleration-library 1.0.1__tar.gz → 1.1.0__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.
- {cosmotech_acceleration_library-1.0.1/cosmotech_acceleration_library.egg-info → cosmotech_acceleration_library-1.1.0}/PKG-INFO +7 -5
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/__init__.py +1 -1
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/__init__.py +10 -6
- cosmotech_acceleration_library-1.1.0/cosmotech/coal/cosmotech_api/dataset/download/file.py +229 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/twingraph.py +10 -13
- cosmotech_acceleration_library-1.1.0/cosmotech/coal/cosmotech_api/dataset/upload.py +41 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/datasets.py +71 -19
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/download.py +3 -14
- cosmotech_acceleration_library-1.1.0/cosmotech/coal/utils/decorator.py +25 -0
- cosmotech_acceleration_library-1.1.0/cosmotech/coal/utils/semver.py +6 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/wsf_load_file.py +5 -3
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/wsf_send_file.py +4 -2
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/store.py +0 -1
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0/cosmotech_acceleration_library.egg-info}/PKG-INFO +7 -5
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/SOURCES.txt +4 -1
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/requires.txt +7 -4
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/pyproject.toml +1 -0
- cosmotech_acceleration_library-1.1.0/requirements.past.txt +1 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/requirements.txt +5 -4
- cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/download/file.py +0 -216
- cosmotech_acceleration_library-1.0.1/cosmotech/coal/utils/api.py +0 -68
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/LICENSE +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/MANIFEST.in +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/README.md +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/aws/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/aws/s3.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/auth.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/ingestion.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/query.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/runner.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/store.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/tables.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/utils.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/blob.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/functions.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/storage.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/connection.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/converters.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/adt.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/common.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/utils.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/parameters.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/run.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/run_data.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/run_template.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/data.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/metadata.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/parameters.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/twin_data_layer.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/workspace.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/csm/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/csm/engine/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/postgresql/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/postgresql/runner.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/postgresql/store.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/singlestore/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/singlestore/store.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/csv.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/native_python.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/pandas.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/pyarrow.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/store.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/utils/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/utils/logger.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/utils/postgresql.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/adx_send_data.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/adx_send_runnerdata.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/api.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/postgres_send_runner_metadata.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/rds_load_csv.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/rds_send_csv.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/rds_send_store.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/run_load_data.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/runtemplate_load_handler.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/tdl_load_files.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/tdl_send_files.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/az_storage_upload.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/s3_bucket_delete.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/s3_bucket_download.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/s3_bucket_upload.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/dump_to_azure.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/dump_to_postgresql.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/dump_to_s3.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/list_tables.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/load_csv_folder.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/load_from_singlestore.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/reset.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/main.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/utils/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/utils/click.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/utils/decorators.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/postgres_send_runner_metadata.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_load_csv.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_send_csv.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_send_store.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/run_load_data.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/runtemplate_load_handler.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/tdl_load_files.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/tdl_send_files.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/try_api_connection.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/wsf_load_file.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/wsf_send_file.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/adx_send_runnerdata.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/az_storage_upload.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_delete.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_download.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_upload.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_azure.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_postgresql.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_s3.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_list_tables.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_load_csv_folder.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_load_from_singlestore.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_reset.json +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/data_transfer.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/errors.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/file_operations.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/progress.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/timing.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/validation.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/connection.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/run_data.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/run_template.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/runner.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/solution.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/workspace.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/adx.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/api.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/azure_storage.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/database.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/dataset.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/postgresql.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/s3.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/solution.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/web.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/__init__.py +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/api.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/postgres_send_runner_metadata.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_load_csv.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_csv.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_store.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/run_load_data.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/runtemplate_load_handler.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_load_files.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_send_files.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_load_file.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_send_file.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/main.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_data.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_runnerdata.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/az_storage_upload.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_delete.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_download.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_upload.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/storage.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_azure.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_postgresql.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_s3.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/list_tables.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_csv_folder.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_from_singlestore.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/reset.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/store.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commons/decorators.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/en-US/csm_data/commons/version.yml +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/dependency_links.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/entry_points.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/not-zip-safe +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/top_level.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/requirements.all.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/requirements.dev.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/requirements.doc.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/requirements.extra.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/requirements.test.txt +0 -0
- {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-1.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cosmotech_acceleration_library
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Acceleration libraries for CosmoTech cloud based solution development
|
|
5
5
|
Author-email: Cosmo Tech <platform@cosmotech.com>
|
|
6
6
|
Project-URL: Homepage, https://www.cosmotech.com
|
|
@@ -15,15 +15,15 @@ Requires-Dist: azure-kusto-data~=4.4.1
|
|
|
15
15
|
Requires-Dist: azure-kusto-ingest~=4.4.1
|
|
16
16
|
Requires-Dist: tenacity~=8.3.0
|
|
17
17
|
Requires-Dist: python-keycloak~=4.7.3
|
|
18
|
-
Requires-Dist: cosmotech-api
|
|
18
|
+
Requires-Dist: cosmotech-api>=3.2
|
|
19
19
|
Requires-Dist: boto3~=1.35.19
|
|
20
20
|
Requires-Dist: requests~=2.32.3
|
|
21
21
|
Requires-Dist: singlestoredb~=1.10.0
|
|
22
22
|
Requires-Dist: cosmotech-run-orchestrator~=2.0.0
|
|
23
23
|
Requires-Dist: pyarrow~=20.0.0
|
|
24
|
-
Requires-Dist: adbc-driver-manager~=1.
|
|
25
|
-
Requires-Dist: adbc-driver-sqlite~=1.
|
|
26
|
-
Requires-Dist: adbc-driver-postgresql~=1.
|
|
24
|
+
Requires-Dist: adbc-driver-manager~=1.7.0
|
|
25
|
+
Requires-Dist: adbc-driver-sqlite~=1.7.0
|
|
26
|
+
Requires-Dist: adbc-driver-postgresql~=1.7.0
|
|
27
27
|
Requires-Dist: click~=8.1.7
|
|
28
28
|
Requires-Dist: rich-click~=1.7.3
|
|
29
29
|
Requires-Dist: click-log~=0.4.0
|
|
@@ -58,6 +58,8 @@ Requires-Dist: black~=24.3.0; extra == "dev"
|
|
|
58
58
|
Requires-Dist: pre-commit~=3.3.2; extra == "dev"
|
|
59
59
|
Provides-Extra: all
|
|
60
60
|
Requires-Dist: CosmoTech_Acceleration_Library[dev,doc,extra,test]; extra == "all"
|
|
61
|
+
Provides-Extra: past
|
|
62
|
+
Requires-Dist: cosmotech-api~=3.2; extra == "past"
|
|
61
63
|
Dynamic: license-file
|
|
62
64
|
|
|
63
65
|
# CosmoTech-Acceleration-Library (CoAL)
|
|
@@ -16,12 +16,16 @@ from cosmotech.coal.cosmotech_api.parameters import (
|
|
|
16
16
|
write_parameters,
|
|
17
17
|
)
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
from cosmotech.coal.utils.semver import semver_of
|
|
20
|
+
|
|
21
|
+
csm_version = semver_of("cosmotech_api")
|
|
22
|
+
if csm_version.major < 5:
|
|
23
|
+
# Re-export functions from the twin_data_layer module
|
|
24
|
+
from cosmotech.coal.cosmotech_api.twin_data_layer import (
|
|
25
|
+
get_dataset_id_from_runner,
|
|
26
|
+
send_files_to_tdl,
|
|
27
|
+
load_files_from_tdl,
|
|
28
|
+
)
|
|
25
29
|
|
|
26
30
|
# Re-export functions from the run_data module
|
|
27
31
|
from cosmotech.coal.cosmotech_api.run_data import (
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
# Copyright (C) - 2023 - 2025 - Cosmo Tech
|
|
2
|
+
# This document and all information contained herein is the exclusive property -
|
|
3
|
+
# including all intellectual property rights pertaining thereto - of Cosmo Tech.
|
|
4
|
+
# Any use, reproduction, translation, broadcasting, transmission, distribution,
|
|
5
|
+
# etc., to any person is prohibited unless it has been previously and
|
|
6
|
+
# specifically authorized by written means by Cosmo Tech.
|
|
7
|
+
|
|
8
|
+
import csv
|
|
9
|
+
import io
|
|
10
|
+
import json
|
|
11
|
+
import os
|
|
12
|
+
import tempfile
|
|
13
|
+
import time
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
from typing import Dict, Any, Optional, Union, Tuple
|
|
16
|
+
|
|
17
|
+
from cosmotech_api import WorkspaceApi
|
|
18
|
+
from openpyxl import load_workbook
|
|
19
|
+
|
|
20
|
+
from cosmotech.coal.utils.decorator import timed
|
|
21
|
+
from cosmotech.coal.utils.logger import LOGGER
|
|
22
|
+
from cosmotech.orchestrator.utils.translate import T
|
|
23
|
+
from cosmotech.coal.cosmotech_api.connection import get_api_client
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def process_xls(target_file) -> Dict[str, Any]:
|
|
27
|
+
content = {}
|
|
28
|
+
|
|
29
|
+
LOGGER.debug(T("coal.services.dataset.processing_excel").format(file_name=target_file))
|
|
30
|
+
wb = load_workbook(target_file, data_only=True)
|
|
31
|
+
|
|
32
|
+
for sheet_name in wb.sheetnames:
|
|
33
|
+
sheet = wb[sheet_name]
|
|
34
|
+
content[sheet_name] = list()
|
|
35
|
+
headers = next(sheet.iter_rows(max_row=1, values_only=True))
|
|
36
|
+
|
|
37
|
+
row_count = 0
|
|
38
|
+
for r in sheet.iter_rows(min_row=2, values_only=True):
|
|
39
|
+
row = {k: v for k, v in zip(headers, r)}
|
|
40
|
+
new_row = dict()
|
|
41
|
+
|
|
42
|
+
for key, value in row.items():
|
|
43
|
+
try:
|
|
44
|
+
converted_value = json.load(io.StringIO(value))
|
|
45
|
+
except (json.decoder.JSONDecodeError, TypeError):
|
|
46
|
+
converted_value = value
|
|
47
|
+
|
|
48
|
+
if converted_value is not None:
|
|
49
|
+
new_row[key] = converted_value
|
|
50
|
+
|
|
51
|
+
if new_row:
|
|
52
|
+
content[sheet_name].append(new_row)
|
|
53
|
+
row_count += 1
|
|
54
|
+
|
|
55
|
+
LOGGER.debug(T("coal.services.dataset.sheet_processed").format(sheet_name=sheet_name, rows=row_count))
|
|
56
|
+
return content
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def process_csv(target_file) -> Dict[str, Any]:
|
|
60
|
+
content = {}
|
|
61
|
+
|
|
62
|
+
LOGGER.debug(T("coal.services.dataset.processing_csv").format(file_name=target_file))
|
|
63
|
+
with open(target_file, "r") as file:
|
|
64
|
+
current_filename = os.path.basename(target_file)[: -len(".csv")]
|
|
65
|
+
content[current_filename] = list()
|
|
66
|
+
|
|
67
|
+
row_count = 0
|
|
68
|
+
for csv_row in csv.DictReader(file):
|
|
69
|
+
csv_row: dict
|
|
70
|
+
new_row = dict()
|
|
71
|
+
|
|
72
|
+
for key, value in csv_row.items():
|
|
73
|
+
try:
|
|
74
|
+
# Try to convert any json row to dict object
|
|
75
|
+
converted_value = json.load(io.StringIO(value))
|
|
76
|
+
except json.decoder.JSONDecodeError:
|
|
77
|
+
converted_value = value
|
|
78
|
+
|
|
79
|
+
if converted_value == "":
|
|
80
|
+
converted_value = None
|
|
81
|
+
|
|
82
|
+
if converted_value is not None:
|
|
83
|
+
new_row[key] = converted_value
|
|
84
|
+
|
|
85
|
+
content[current_filename].append(new_row)
|
|
86
|
+
row_count += 1
|
|
87
|
+
|
|
88
|
+
LOGGER.debug(T("coal.services.dataset.csv_processed").format(file_name=current_filename, rows=row_count))
|
|
89
|
+
return content
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def process_json(target_file) -> Dict[str, Any]:
|
|
93
|
+
content = {}
|
|
94
|
+
LOGGER.debug(T("coal.services.dataset.processing_json").format(file_name=target_file))
|
|
95
|
+
with open(target_file, "r") as _file:
|
|
96
|
+
current_filename = os.path.basename(target_file)
|
|
97
|
+
content[current_filename] = json.load(_file)
|
|
98
|
+
|
|
99
|
+
if isinstance(content[current_filename], dict):
|
|
100
|
+
item_count = len(content[current_filename])
|
|
101
|
+
elif isinstance(content[current_filename], list):
|
|
102
|
+
item_count = len(content[current_filename])
|
|
103
|
+
else:
|
|
104
|
+
item_count = 1
|
|
105
|
+
|
|
106
|
+
LOGGER.debug(T("coal.services.dataset.json_processed").format(file_name=current_filename, items=item_count))
|
|
107
|
+
return content
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
def process_txt(target_file) -> Dict[str, Any]:
|
|
111
|
+
content = {}
|
|
112
|
+
LOGGER.debug(T("coal.services.dataset.processing_text").format(file_name=target_file))
|
|
113
|
+
with open(target_file, "r") as _file:
|
|
114
|
+
current_filename = os.path.basename(target_file)
|
|
115
|
+
content[current_filename] = _file.read()
|
|
116
|
+
|
|
117
|
+
line_count = content[current_filename].count("\n") + 1
|
|
118
|
+
LOGGER.debug(T("coal.services.dataset.text_processed").format(file_name=current_filename, lines=line_count))
|
|
119
|
+
return content
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def read_file(file_name, file):
|
|
123
|
+
@timed(f"process {file_name}", debug=True)
|
|
124
|
+
def timed_read_file(file_name, file):
|
|
125
|
+
content = {}
|
|
126
|
+
if ".xls" in file_name:
|
|
127
|
+
content.update(process_xls(file))
|
|
128
|
+
elif ".csv" in file_name:
|
|
129
|
+
content.update(process_csv(file))
|
|
130
|
+
elif ".json" in file_name:
|
|
131
|
+
content.update(process_json(file))
|
|
132
|
+
else:
|
|
133
|
+
content.update(process_txt(file))
|
|
134
|
+
return content
|
|
135
|
+
|
|
136
|
+
return timed_read_file(file_name, file)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
def download_file_dataset(
|
|
140
|
+
organization_id: str,
|
|
141
|
+
workspace_id: str,
|
|
142
|
+
file_name: str,
|
|
143
|
+
target_folder: Optional[Union[str, Path]] = None,
|
|
144
|
+
read_files: bool = True,
|
|
145
|
+
) -> Tuple[Dict[str, Any], Path]:
|
|
146
|
+
"""
|
|
147
|
+
Download file dataset.
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
organization_id: Organization ID
|
|
151
|
+
workspace_id: Workspace ID
|
|
152
|
+
file_name: File name to download
|
|
153
|
+
target_folder: Optional folder to save files (if None, uses temp dir)
|
|
154
|
+
read_files: Whether to read file contents
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
Tuple of (content dict, folder path)
|
|
158
|
+
"""
|
|
159
|
+
start_time = time.time()
|
|
160
|
+
LOGGER.info(T("coal.services.dataset.download_started").format(dataset_type="File"))
|
|
161
|
+
LOGGER.debug(
|
|
162
|
+
T("coal.services.dataset.file_downloading").format(
|
|
163
|
+
organization_id=organization_id,
|
|
164
|
+
workspace_id=workspace_id,
|
|
165
|
+
file_name=file_name,
|
|
166
|
+
)
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
# Create temp directory for downloaded files
|
|
170
|
+
if target_folder is None:
|
|
171
|
+
tmp_dataset_dir = tempfile.mkdtemp()
|
|
172
|
+
else:
|
|
173
|
+
tmp_dataset_dir = Path(target_folder)
|
|
174
|
+
tmp_dataset_dir.mkdir(parents=True, exist_ok=True)
|
|
175
|
+
tmp_dataset_dir = str(tmp_dataset_dir)
|
|
176
|
+
|
|
177
|
+
LOGGER.debug(T("coal.services.dataset.using_folder").format(folder=tmp_dataset_dir))
|
|
178
|
+
|
|
179
|
+
content = dict()
|
|
180
|
+
|
|
181
|
+
with get_api_client()[0] as api_client:
|
|
182
|
+
api_ws = WorkspaceApi(api_client)
|
|
183
|
+
|
|
184
|
+
# Find all files matching the pattern
|
|
185
|
+
list_start = time.time()
|
|
186
|
+
LOGGER.debug(T("coal.services.dataset.listing_workspace_files"))
|
|
187
|
+
all_api_files = api_ws.find_all_workspace_files(organization_id, workspace_id)
|
|
188
|
+
|
|
189
|
+
existing_files = list(_f.file_name for _f in all_api_files if _f.file_name.startswith(file_name))
|
|
190
|
+
list_time = time.time() - list_start
|
|
191
|
+
|
|
192
|
+
LOGGER.debug(T("coal.services.dataset.workspace_files_found").format(count=len(existing_files)))
|
|
193
|
+
LOGGER.debug(T("coal.common.timing.operation_completed").format(operation="file listing", time=list_time))
|
|
194
|
+
|
|
195
|
+
if not existing_files:
|
|
196
|
+
LOGGER.warning(T("coal.services.dataset.no_files_found").format(file_name=file_name))
|
|
197
|
+
return content, Path(tmp_dataset_dir)
|
|
198
|
+
|
|
199
|
+
# Download and process each file
|
|
200
|
+
for _file_name in existing_files:
|
|
201
|
+
download_start = time.time()
|
|
202
|
+
LOGGER.debug(T("coal.services.dataset.downloading_file").format(file_name=_file_name))
|
|
203
|
+
|
|
204
|
+
dl_file = api_ws.download_workspace_file(
|
|
205
|
+
organization_id=organization_id,
|
|
206
|
+
workspace_id=workspace_id,
|
|
207
|
+
file_name=_file_name,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
target_file = os.path.join(tmp_dataset_dir, _file_name.split("/")[-1])
|
|
211
|
+
with open(target_file, "wb") as tmp_file:
|
|
212
|
+
tmp_file.write(dl_file)
|
|
213
|
+
|
|
214
|
+
download_time = time.time() - download_start
|
|
215
|
+
LOGGER.debug(T("coal.services.dataset.file_downloaded").format(file_name=_file_name, path=target_file))
|
|
216
|
+
LOGGER.debug(
|
|
217
|
+
T("coal.common.timing.operation_completed").format(
|
|
218
|
+
operation=f"download {_file_name}", time=download_time
|
|
219
|
+
)
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
if read_files:
|
|
223
|
+
content.update(read_file(_file_name, target_file))
|
|
224
|
+
|
|
225
|
+
elapsed_time = time.time() - start_time
|
|
226
|
+
LOGGER.info(T("coal.common.timing.operation_completed").format(operation="File download", time=elapsed_time))
|
|
227
|
+
LOGGER.info(T("coal.services.dataset.download_completed").format(dataset_type="File"))
|
|
228
|
+
|
|
229
|
+
return content, Path(tmp_dataset_dir)
|
|
@@ -8,14 +8,9 @@
|
|
|
8
8
|
import time
|
|
9
9
|
import tempfile
|
|
10
10
|
from pathlib import Path
|
|
11
|
-
from typing import Dict,
|
|
11
|
+
from typing import Dict, Any, Optional, Union, Tuple
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
DatasetApi,
|
|
15
|
-
DatasetTwinGraphQuery,
|
|
16
|
-
TwinGraphQuery,
|
|
17
|
-
TwingraphApi,
|
|
18
|
-
)
|
|
13
|
+
import cosmotech_api
|
|
19
14
|
|
|
20
15
|
from cosmotech.coal.utils.logger import LOGGER
|
|
21
16
|
from cosmotech.orchestrator.utils.translate import T
|
|
@@ -47,12 +42,12 @@ def download_twingraph_dataset(
|
|
|
47
42
|
)
|
|
48
43
|
|
|
49
44
|
with get_api_client()[0] as api_client:
|
|
50
|
-
dataset_api = DatasetApi(api_client)
|
|
45
|
+
dataset_api = cosmotech_api.DatasetApi(api_client)
|
|
51
46
|
|
|
52
47
|
# Query nodes
|
|
53
48
|
nodes_start = time.time()
|
|
54
49
|
LOGGER.debug(T("coal.services.dataset.twingraph_querying_nodes").format(dataset_id=dataset_id))
|
|
55
|
-
nodes_query = DatasetTwinGraphQuery(query="MATCH(n) RETURN n")
|
|
50
|
+
nodes_query = cosmotech_api.DatasetTwinGraphQuery(query="MATCH(n) RETURN n")
|
|
56
51
|
|
|
57
52
|
nodes = dataset_api.twingraph_query(
|
|
58
53
|
organization_id=organization_id,
|
|
@@ -67,7 +62,9 @@ def download_twingraph_dataset(
|
|
|
67
62
|
# Query edges
|
|
68
63
|
edges_start = time.time()
|
|
69
64
|
LOGGER.debug(T("coal.services.dataset.twingraph_querying_edges").format(dataset_id=dataset_id))
|
|
70
|
-
edges_query = DatasetTwinGraphQuery(
|
|
65
|
+
edges_query = cosmotech_api.DatasetTwinGraphQuery(
|
|
66
|
+
query="MATCH(n)-[r]->(m) RETURN n as src, r as rel, m as dest"
|
|
67
|
+
)
|
|
71
68
|
|
|
72
69
|
edges = dataset_api.twingraph_query(
|
|
73
70
|
organization_id=organization_id,
|
|
@@ -129,12 +126,12 @@ def download_legacy_twingraph_dataset(
|
|
|
129
126
|
)
|
|
130
127
|
|
|
131
128
|
with get_api_client()[0] as api_client:
|
|
132
|
-
api_instance = TwingraphApi(api_client)
|
|
129
|
+
api_instance = cosmotech_api.TwingraphApi(api_client)
|
|
133
130
|
|
|
134
131
|
# Query nodes
|
|
135
132
|
nodes_start = time.time()
|
|
136
133
|
LOGGER.debug(T("coal.services.dataset.legacy_twingraph_querying_nodes").format(cache_name=cache_name))
|
|
137
|
-
_query_nodes = TwinGraphQuery(query="MATCH(n) RETURN n")
|
|
134
|
+
_query_nodes = cosmotech_api.TwinGraphQuery(query="MATCH(n) RETURN n")
|
|
138
135
|
|
|
139
136
|
nodes = api_instance.query(
|
|
140
137
|
organization_id=organization_id,
|
|
@@ -149,7 +146,7 @@ def download_legacy_twingraph_dataset(
|
|
|
149
146
|
# Query relationships
|
|
150
147
|
rel_start = time.time()
|
|
151
148
|
LOGGER.debug(T("coal.services.dataset.legacy_twingraph_querying_relations").format(cache_name=cache_name))
|
|
152
|
-
_query_rel = TwinGraphQuery(query="MATCH(n)-[r]->(m) RETURN n as src, r as rel, m as dest")
|
|
149
|
+
_query_rel = cosmotech_api.TwinGraphQuery(query="MATCH(n)-[r]->(m) RETURN n as src, r as rel, m as dest")
|
|
153
150
|
|
|
154
151
|
rel = api_instance.query(
|
|
155
152
|
organization_id=organization_id,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import pathlib
|
|
2
|
+
|
|
3
|
+
from cosmotech_api import Dataset
|
|
4
|
+
from cosmotech_api import DatasetPartTypeEnum
|
|
5
|
+
from cosmotech_api.api.dataset_api import DatasetApi
|
|
6
|
+
from cosmotech_api.api.dataset_api import DatasetCreateRequest
|
|
7
|
+
from cosmotech_api.api.dataset_api import DatasetPartCreateRequest
|
|
8
|
+
import pprint
|
|
9
|
+
|
|
10
|
+
from cosmotech.coal.cosmotech_api.connection import get_api_client
|
|
11
|
+
from cosmotech.coal.utils.logger import LOGGER
|
|
12
|
+
|
|
13
|
+
LOGGER.info("Generating dataset content")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def upload_dataset(organization_id, workspace_id, dataset_name, dataset_dir) -> Dataset:
|
|
17
|
+
dataset_path = pathlib.Path(dataset_dir)
|
|
18
|
+
|
|
19
|
+
with get_api_client()[0] as client:
|
|
20
|
+
d_api = DatasetApi(client)
|
|
21
|
+
_files = list(_p for _p in dataset_path.rglob("*") if _p.is_file())
|
|
22
|
+
d_request = DatasetCreateRequest(
|
|
23
|
+
name=dataset_name,
|
|
24
|
+
parts=list(
|
|
25
|
+
DatasetPartCreateRequest(
|
|
26
|
+
name=_p.name,
|
|
27
|
+
description=str(_p.relative_to(dataset_path)),
|
|
28
|
+
sourceName=str(_p.relative_to(dataset_path)),
|
|
29
|
+
type=DatasetPartTypeEnum.FILE,
|
|
30
|
+
)
|
|
31
|
+
for _p in _files
|
|
32
|
+
),
|
|
33
|
+
)
|
|
34
|
+
pprint.pprint(d_request.to_dict())
|
|
35
|
+
d_ret = d_api.create_dataset(
|
|
36
|
+
organization_id,
|
|
37
|
+
workspace_id,
|
|
38
|
+
d_request,
|
|
39
|
+
files=list((str(_p.relative_to(dataset_path)), _p.open("rb").read()) for _p in _files),
|
|
40
|
+
)
|
|
41
|
+
return d_ret
|
|
@@ -12,7 +12,7 @@ Dataset handling functions.
|
|
|
12
12
|
import multiprocessing
|
|
13
13
|
import tempfile
|
|
14
14
|
from pathlib import Path
|
|
15
|
-
from typing import Dict, List, Any, Optional, Union
|
|
15
|
+
from typing import Dict, List, Any, Optional, Union
|
|
16
16
|
|
|
17
17
|
from azure.identity import DefaultAzureCredential
|
|
18
18
|
from cosmotech_api.api.dataset_api import DatasetApi
|
|
@@ -25,6 +25,7 @@ from cosmotech.coal.cosmotech_api.dataset import (
|
|
|
25
25
|
download_legacy_twingraph_dataset,
|
|
26
26
|
download_file_dataset,
|
|
27
27
|
)
|
|
28
|
+
from cosmotech.coal.cosmotech_api.dataset.download import file
|
|
28
29
|
from cosmotech.coal.utils.logger import LOGGER
|
|
29
30
|
from cosmotech.orchestrator.utils.translate import T
|
|
30
31
|
|
|
@@ -54,7 +55,72 @@ def download_dataset(
|
|
|
54
55
|
workspace_id: str,
|
|
55
56
|
dataset_id: str,
|
|
56
57
|
read_files: bool = True,
|
|
57
|
-
|
|
58
|
+
) -> Dict[str, Any]:
|
|
59
|
+
"""
|
|
60
|
+
retro-compatibility to cosmo-api v4
|
|
61
|
+
"""
|
|
62
|
+
from cosmotech.coal.utils.semver import semver_of
|
|
63
|
+
|
|
64
|
+
csm_version = semver_of("cosmotech_api")
|
|
65
|
+
if csm_version.major >= 5:
|
|
66
|
+
return download_dataset_v5(organization_id, workspace_id, dataset_id, read_files)
|
|
67
|
+
else:
|
|
68
|
+
return download_dataset_v4(organization_id, workspace_id, dataset_id, read_files)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def download_dataset_v5(
|
|
72
|
+
organization_id: str,
|
|
73
|
+
workspace_id: str,
|
|
74
|
+
dataset_id: str,
|
|
75
|
+
read_files: bool = True,
|
|
76
|
+
) -> Dict[str, Any]:
|
|
77
|
+
"""
|
|
78
|
+
Download a single dataset by ID.
|
|
79
|
+
|
|
80
|
+
Args:
|
|
81
|
+
organization_id: Organization ID
|
|
82
|
+
workspace_id: Workspace ID
|
|
83
|
+
dataset_id: Dataset ID
|
|
84
|
+
read_files: Whether to read file contents
|
|
85
|
+
|
|
86
|
+
Returns:
|
|
87
|
+
Dataset information dictionary
|
|
88
|
+
"""
|
|
89
|
+
|
|
90
|
+
# Get dataset information
|
|
91
|
+
with get_api_client()[0] as api_client:
|
|
92
|
+
dataset_api_instance = DatasetApi(api_client)
|
|
93
|
+
dataset = dataset_api_instance.get_dataset(
|
|
94
|
+
organization_id=organization_id, workspace_id=workspace_id, dataset_id=dataset_id
|
|
95
|
+
)
|
|
96
|
+
|
|
97
|
+
content = dict()
|
|
98
|
+
tmp_dataset_dir = tempfile.mkdtemp()
|
|
99
|
+
tmp_dataset_dir_path = Path(tmp_dataset_dir)
|
|
100
|
+
for part in dataset.parts:
|
|
101
|
+
part_file_path = tmp_dataset_dir_path / part.source_name
|
|
102
|
+
part_file_path.parent.mkdir(parents=True, exist_ok=True)
|
|
103
|
+
data_part = dataset_api_instance.download_dataset_part(organization_id, workspace_id, dataset_id, part.id)
|
|
104
|
+
with open(part_file_path, "wb") as binary_file:
|
|
105
|
+
binary_file.write(data_part)
|
|
106
|
+
|
|
107
|
+
if read_files:
|
|
108
|
+
content.update(file.read_file(part.source_name, part_file_path))
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
"type": "csm_dataset",
|
|
112
|
+
"content": content,
|
|
113
|
+
"name": dataset.name,
|
|
114
|
+
"folder_path": tmp_dataset_dir,
|
|
115
|
+
"dataset_id": dataset_id,
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def download_dataset_v4(
|
|
120
|
+
organization_id: str,
|
|
121
|
+
workspace_id: str,
|
|
122
|
+
dataset_id: str,
|
|
123
|
+
read_files: bool = True,
|
|
58
124
|
) -> Dict[str, Any]:
|
|
59
125
|
"""
|
|
60
126
|
Download a single dataset by ID.
|
|
@@ -64,7 +130,6 @@ def download_dataset(
|
|
|
64
130
|
workspace_id: Workspace ID
|
|
65
131
|
dataset_id: Dataset ID
|
|
66
132
|
read_files: Whether to read file contents
|
|
67
|
-
credentials: Azure credentials (if None, uses DefaultAzureCredential if needed)
|
|
68
133
|
|
|
69
134
|
Returns:
|
|
70
135
|
Dataset information dictionary
|
|
@@ -91,7 +156,7 @@ def download_dataset(
|
|
|
91
156
|
if is_adt:
|
|
92
157
|
content, folder_path = download_adt_dataset(
|
|
93
158
|
adt_address=parameters["AZURE_DIGITAL_TWINS_URL"],
|
|
94
|
-
credentials=
|
|
159
|
+
credentials=DefaultAzureCredential(),
|
|
95
160
|
)
|
|
96
161
|
return {
|
|
97
162
|
"type": "adt",
|
|
@@ -159,9 +224,7 @@ def download_dataset(
|
|
|
159
224
|
}
|
|
160
225
|
|
|
161
226
|
|
|
162
|
-
def download_dataset_process(
|
|
163
|
-
_dataset_id, organization_id, workspace_id, read_files, credentials, _return_dict, _error_dict
|
|
164
|
-
):
|
|
227
|
+
def download_dataset_process(_dataset_id, organization_id, workspace_id, read_files, _return_dict, _error_dict):
|
|
165
228
|
"""
|
|
166
229
|
Process function for downloading a dataset in a separate process.
|
|
167
230
|
|
|
@@ -174,7 +237,6 @@ def download_dataset_process(
|
|
|
174
237
|
organization_id: Organization ID
|
|
175
238
|
workspace_id: Workspace ID
|
|
176
239
|
read_files: Whether to read file contents
|
|
177
|
-
credentials: Azure credentials (if None, uses DefaultAzureCredential if needed)
|
|
178
240
|
_return_dict: Shared dictionary to store successful download results
|
|
179
241
|
_error_dict: Shared dictionary to store error messages
|
|
180
242
|
|
|
@@ -187,7 +249,6 @@ def download_dataset_process(
|
|
|
187
249
|
workspace_id=workspace_id,
|
|
188
250
|
dataset_id=_dataset_id,
|
|
189
251
|
read_files=read_files,
|
|
190
|
-
credentials=credentials,
|
|
191
252
|
)
|
|
192
253
|
_return_dict[_dataset_id] = _c
|
|
193
254
|
except Exception as e:
|
|
@@ -200,7 +261,6 @@ def download_datasets_parallel(
|
|
|
200
261
|
workspace_id: str,
|
|
201
262
|
dataset_ids: List[str],
|
|
202
263
|
read_files: bool = True,
|
|
203
|
-
credentials: Optional[DefaultAzureCredential] = None,
|
|
204
264
|
) -> Dict[str, Dict[str, Any]]:
|
|
205
265
|
"""
|
|
206
266
|
Download multiple datasets in parallel.
|
|
@@ -210,7 +270,6 @@ def download_datasets_parallel(
|
|
|
210
270
|
workspace_id: Workspace ID
|
|
211
271
|
dataset_ids: List of dataset IDs
|
|
212
272
|
read_files: Whether to read file contents
|
|
213
|
-
credentials: Azure credentials (if None, uses DefaultAzureCredential if needed)
|
|
214
273
|
|
|
215
274
|
Returns:
|
|
216
275
|
Dictionary mapping dataset IDs to dataset information
|
|
@@ -225,7 +284,7 @@ def download_datasets_parallel(
|
|
|
225
284
|
dataset_id,
|
|
226
285
|
multiprocessing.Process(
|
|
227
286
|
target=download_dataset_process,
|
|
228
|
-
args=(dataset_id, organization_id, workspace_id, read_files,
|
|
287
|
+
args=(dataset_id, organization_id, workspace_id, read_files, return_dict, error_dict),
|
|
229
288
|
),
|
|
230
289
|
)
|
|
231
290
|
for dataset_id in dataset_ids
|
|
@@ -251,7 +310,6 @@ def download_datasets_sequential(
|
|
|
251
310
|
workspace_id: str,
|
|
252
311
|
dataset_ids: List[str],
|
|
253
312
|
read_files: bool = True,
|
|
254
|
-
credentials: Optional[DefaultAzureCredential] = None,
|
|
255
313
|
) -> Dict[str, Dict[str, Any]]:
|
|
256
314
|
"""
|
|
257
315
|
Download multiple datasets sequentially.
|
|
@@ -261,7 +319,6 @@ def download_datasets_sequential(
|
|
|
261
319
|
workspace_id: Workspace ID
|
|
262
320
|
dataset_ids: List of dataset IDs
|
|
263
321
|
read_files: Whether to read file contents
|
|
264
|
-
credentials: Azure credentials (if None, uses DefaultAzureCredential if needed)
|
|
265
322
|
|
|
266
323
|
Returns:
|
|
267
324
|
Dictionary mapping dataset IDs to dataset information
|
|
@@ -279,7 +336,6 @@ def download_datasets_sequential(
|
|
|
279
336
|
workspace_id=workspace_id,
|
|
280
337
|
dataset_id=dataset_id,
|
|
281
338
|
read_files=read_files,
|
|
282
|
-
credentials=credentials,
|
|
283
339
|
)
|
|
284
340
|
except Exception as e:
|
|
285
341
|
error_dict[dataset_id] = f"{type(e).__name__}: {str(e)}"
|
|
@@ -294,7 +350,6 @@ def download_datasets(
|
|
|
294
350
|
dataset_ids: List[str],
|
|
295
351
|
read_files: bool = True,
|
|
296
352
|
parallel: bool = True,
|
|
297
|
-
credentials: Optional[DefaultAzureCredential] = None,
|
|
298
353
|
) -> Dict[str, Dict[str, Any]]:
|
|
299
354
|
"""
|
|
300
355
|
Download multiple datasets, either in parallel or sequentially.
|
|
@@ -305,7 +360,6 @@ def download_datasets(
|
|
|
305
360
|
dataset_ids: List of dataset IDs
|
|
306
361
|
read_files: Whether to read file contents
|
|
307
362
|
parallel: Whether to download in parallel
|
|
308
|
-
credentials: Azure credentials (if None, uses DefaultAzureCredential if needed)
|
|
309
363
|
|
|
310
364
|
Returns:
|
|
311
365
|
Dictionary mapping dataset IDs to dataset information
|
|
@@ -319,7 +373,6 @@ def download_datasets(
|
|
|
319
373
|
workspace_id=workspace_id,
|
|
320
374
|
dataset_ids=dataset_ids,
|
|
321
375
|
read_files=read_files,
|
|
322
|
-
credentials=credentials,
|
|
323
376
|
)
|
|
324
377
|
else:
|
|
325
378
|
return download_datasets_sequential(
|
|
@@ -327,7 +380,6 @@ def download_datasets(
|
|
|
327
380
|
workspace_id=workspace_id,
|
|
328
381
|
dataset_ids=dataset_ids,
|
|
329
382
|
read_files=read_files,
|
|
330
|
-
credentials=credentials,
|
|
331
383
|
)
|
|
332
384
|
|
|
333
385
|
|
|
@@ -12,13 +12,8 @@ Orchestration functions for downloading runner and run data.
|
|
|
12
12
|
import os
|
|
13
13
|
import pathlib
|
|
14
14
|
import shutil
|
|
15
|
-
from typing import Dict,
|
|
15
|
+
from typing import Dict, Any, Optional
|
|
16
16
|
|
|
17
|
-
from azure.identity import DefaultAzureCredential
|
|
18
|
-
from cosmotech_api.api.runner_api import RunnerApi
|
|
19
|
-
from cosmotech_api.exceptions import ApiException
|
|
20
|
-
|
|
21
|
-
from cosmotech.coal.cosmotech_api.connection import get_api_client
|
|
22
17
|
from cosmotech.coal.cosmotech_api.runner.data import get_runner_data
|
|
23
18
|
from cosmotech.coal.cosmotech_api.runner.parameters import (
|
|
24
19
|
format_parameters_list,
|
|
@@ -65,11 +60,6 @@ def download_runner_data(
|
|
|
65
60
|
"""
|
|
66
61
|
LOGGER.info(T("coal.cosmotech_api.runner.starting_download"))
|
|
67
62
|
|
|
68
|
-
# Get credentials if needed
|
|
69
|
-
credentials = None
|
|
70
|
-
if get_api_client()[1] == "Azure Entra Connection":
|
|
71
|
-
credentials = DefaultAzureCredential()
|
|
72
|
-
|
|
73
63
|
# Get runner data
|
|
74
64
|
runner_data = get_runner_data(organization_id, workspace_id, runner_id)
|
|
75
65
|
|
|
@@ -100,19 +90,18 @@ def download_runner_data(
|
|
|
100
90
|
dataset_ids=dataset_ids,
|
|
101
91
|
read_files=read_files,
|
|
102
92
|
parallel=parallel,
|
|
103
|
-
credentials=credentials,
|
|
104
93
|
)
|
|
105
94
|
|
|
106
95
|
result["datasets"] = datasets
|
|
107
96
|
|
|
108
|
-
#
|
|
97
|
+
# List datasets set as parameter
|
|
109
98
|
datasets_parameters_ids = {
|
|
110
99
|
param.value: param.parameter_id
|
|
111
100
|
for param in runner_data.parameters_values
|
|
112
101
|
if param.var_type == "%DATASETID%" and param.value
|
|
113
102
|
}
|
|
114
103
|
|
|
115
|
-
# Save datasets to parameter folders
|
|
104
|
+
# Save parameter datasets to parameter folders
|
|
116
105
|
for dataset_id, dataset_info in datasets.items():
|
|
117
106
|
# If dataset is referenced by a parameter, save to parameter folder
|
|
118
107
|
if dataset_id in datasets_parameters_ids:
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from functools import wraps
|
|
4
|
+
|
|
5
|
+
from cosmotech.coal.utils.logger import LOGGER
|
|
6
|
+
from cosmotech.orchestrator.utils.translate import T
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def timed(operation, debug=False):
|
|
10
|
+
def decorator(func):
|
|
11
|
+
@wraps(func)
|
|
12
|
+
def wrapper(*args, **kwargs):
|
|
13
|
+
process_start = time.time()
|
|
14
|
+
r = func(*args, **kwargs)
|
|
15
|
+
process_time = time.time() - process_start
|
|
16
|
+
msg = T("coal.common.timing.operation_completed").format(operation=operation, time=process_time)
|
|
17
|
+
if debug:
|
|
18
|
+
LOGGER.debug(msg)
|
|
19
|
+
else:
|
|
20
|
+
LOGGER.info(msg)
|
|
21
|
+
return r
|
|
22
|
+
|
|
23
|
+
return wrapper
|
|
24
|
+
|
|
25
|
+
return decorator
|