cosmotech-acceleration-library 1.0.0__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.
Files changed (189) hide show
  1. {cosmotech_acceleration_library-1.0.0/cosmotech_acceleration_library.egg-info → cosmotech_acceleration_library-1.1.0}/PKG-INFO +13 -14
  2. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/__init__.py +1 -1
  3. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/runner.py +1 -3
  4. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/__init__.py +10 -6
  5. cosmotech_acceleration_library-1.1.0/cosmotech/coal/cosmotech_api/dataset/download/file.py +229 -0
  6. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/twingraph.py +10 -13
  7. cosmotech_acceleration_library-1.1.0/cosmotech/coal/cosmotech_api/dataset/upload.py +41 -0
  8. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/datasets.py +71 -19
  9. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/download.py +3 -14
  10. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/postgresql/runner.py +3 -1
  11. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/postgresql/store.py +3 -0
  12. cosmotech_acceleration_library-1.1.0/cosmotech/coal/utils/decorator.py +25 -0
  13. cosmotech_acceleration_library-1.1.0/cosmotech/coal/utils/semver.py +6 -0
  14. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/adx_send_data.py +7 -7
  15. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/adx_send_runnerdata.py +10 -10
  16. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/api.py +1 -1
  17. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/postgres_send_runner_metadata.py +23 -11
  18. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/rds_load_csv.py +8 -8
  19. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/rds_send_csv.py +6 -6
  20. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/rds_send_store.py +6 -6
  21. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/run_load_data.py +10 -10
  22. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/runtemplate_load_handler.py +5 -5
  23. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/tdl_load_files.py +6 -6
  24. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/tdl_send_files.py +7 -7
  25. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/wsf_load_file.py +10 -8
  26. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/wsf_send_file.py +10 -8
  27. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/az_storage_upload.py +6 -6
  28. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/s3_bucket_delete.py +8 -8
  29. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/s3_bucket_download.py +9 -9
  30. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/s3_bucket_upload.py +10 -10
  31. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/dump_to_azure.py +9 -9
  32. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/dump_to_postgresql.py +22 -10
  33. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/dump_to_s3.py +10 -10
  34. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/list_tables.py +3 -3
  35. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/load_csv_folder.py +3 -3
  36. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/load_from_singlestore.py +8 -8
  37. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/reset.py +2 -2
  38. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/store.py +1 -2
  39. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/main.py +8 -6
  40. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/utils/decorators.py +1 -1
  41. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/api.yml +8 -0
  42. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/postgres_send_runner_metadata.yml +17 -0
  43. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_load_csv.yml +13 -0
  44. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_csv.yml +12 -0
  45. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_store.yml +12 -0
  46. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/run_load_data.yml +15 -0
  47. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/runtemplate_load_handler.yml +7 -0
  48. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_load_files.yml +14 -0
  49. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_send_files.yml +18 -0
  50. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_load_file.yml +10 -0
  51. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_send_file.yml +12 -0
  52. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/main.yml +9 -0
  53. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_data.yml +8 -0
  54. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_runnerdata.yml +15 -0
  55. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/az_storage_upload.yml +8 -0
  56. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_delete.yml +17 -0
  57. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_download.yml +18 -0
  58. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_upload.yml +21 -0
  59. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/storage.yml +4 -0
  60. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_azure.yml +23 -0
  61. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_postgresql.yml +20 -0
  62. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_s3.yml +26 -0
  63. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/list_tables.yml +5 -0
  64. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_csv_folder.yml +5 -0
  65. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_from_singlestore.yml +16 -0
  66. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/reset.yml +4 -0
  67. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/store.yml +4 -0
  68. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commons/decorators.yml +2 -0
  69. cosmotech_acceleration_library-1.1.0/cosmotech/translation/csm_data/en-US/csm_data/commons/version.yml +4 -0
  70. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0/cosmotech_acceleration_library.egg-info}/PKG-INFO +13 -14
  71. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/SOURCES.txt +33 -2
  72. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/requires.txt +13 -13
  73. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/pyproject.toml +1 -0
  74. cosmotech_acceleration_library-1.1.0/requirements.dev.txt +3 -0
  75. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/requirements.doc.txt +3 -4
  76. cosmotech_acceleration_library-1.1.0/requirements.past.txt +1 -0
  77. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/requirements.txt +6 -11
  78. cosmotech_acceleration_library-1.0.0/cosmotech/coal/cosmotech_api/dataset/download/file.py +0 -216
  79. cosmotech_acceleration_library-1.0.0/cosmotech/coal/utils/api.py +0 -68
  80. cosmotech_acceleration_library-1.0.0/cosmotech/translation/csm_data/en-US/csm-data.yml +0 -434
  81. cosmotech_acceleration_library-1.0.0/requirements.dev.txt +0 -3
  82. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/LICENSE +0 -0
  83. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/MANIFEST.in +0 -0
  84. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/README.md +0 -0
  85. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/aws/__init__.py +0 -0
  86. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/aws/s3.py +0 -0
  87. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/__init__.py +0 -0
  88. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/__init__.py +0 -0
  89. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/auth.py +0 -0
  90. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/ingestion.py +0 -0
  91. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/query.py +0 -0
  92. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/store.py +0 -0
  93. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/tables.py +0 -0
  94. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/adx/utils.py +0 -0
  95. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/blob.py +0 -0
  96. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/functions.py +0 -0
  97. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/azure/storage.py +0 -0
  98. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/connection.py +0 -0
  99. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/__init__.py +0 -0
  100. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/converters.py +0 -0
  101. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/__init__.py +0 -0
  102. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/adt.py +0 -0
  103. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/download/common.py +0 -0
  104. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/dataset/utils.py +0 -0
  105. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/parameters.py +0 -0
  106. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/run.py +0 -0
  107. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/run_data.py +0 -0
  108. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/run_template.py +0 -0
  109. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/__init__.py +0 -0
  110. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/data.py +0 -0
  111. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/metadata.py +0 -0
  112. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/runner/parameters.py +0 -0
  113. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/twin_data_layer.py +0 -0
  114. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/cosmotech_api/workspace.py +0 -0
  115. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/csm/__init__.py +0 -0
  116. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/csm/engine/__init__.py +0 -0
  117. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/postgresql/__init__.py +0 -0
  118. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/singlestore/__init__.py +0 -0
  119. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/singlestore/store.py +0 -0
  120. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/__init__.py +0 -0
  121. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/csv.py +0 -0
  122. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/native_python.py +0 -0
  123. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/pandas.py +0 -0
  124. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/pyarrow.py +0 -0
  125. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/store/store.py +0 -0
  126. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/utils/__init__.py +0 -0
  127. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/utils/logger.py +0 -0
  128. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/coal/utils/postgresql.py +0 -0
  129. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/__init__.py +0 -0
  130. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/__init__.py +0 -0
  131. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/api/__init__.py +0 -0
  132. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/commands/store/__init__.py +0 -0
  133. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/utils/__init__.py +0 -0
  134. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/csm_data/utils/click.py +0 -0
  135. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/__init__.py +0 -0
  136. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/postgres_send_runner_metadata.json +0 -0
  137. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_load_csv.json +0 -0
  138. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_send_csv.json +0 -0
  139. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_send_store.json +0 -0
  140. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/run_load_data.json +0 -0
  141. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/runtemplate_load_handler.json +0 -0
  142. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/tdl_load_files.json +0 -0
  143. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/tdl_send_files.json +0 -0
  144. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/try_api_connection.json +0 -0
  145. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/wsf_load_file.json +0 -0
  146. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/wsf_send_file.json +0 -0
  147. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/adx_send_runnerdata.json +0 -0
  148. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/az_storage_upload.json +0 -0
  149. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_delete.json +0 -0
  150. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_download.json +0 -0
  151. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_upload.json +0 -0
  152. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_azure.json +0 -0
  153. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_postgresql.json +0 -0
  154. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_s3.json +0 -0
  155. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_list_tables.json +0 -0
  156. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_load_csv_folder.json +0 -0
  157. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_load_from_singlestore.json +0 -0
  158. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_reset.json +0 -0
  159. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/__init__.py +0 -0
  160. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/data_transfer.yml +0 -0
  161. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/errors.yml +0 -0
  162. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/file_operations.yml +0 -0
  163. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/progress.yml +0 -0
  164. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/timing.yml +0 -0
  165. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/common/validation.yml +0 -0
  166. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/connection.yml +0 -0
  167. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/run_data.yml +0 -0
  168. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/run_template.yml +0 -0
  169. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/runner.yml +0 -0
  170. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/solution.yml +0 -0
  171. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/workspace.yml +0 -0
  172. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/adx.yml +0 -0
  173. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/api.yml +0 -0
  174. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/azure_storage.yml +0 -0
  175. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/database.yml +0 -0
  176. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/dataset.yml +0 -0
  177. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/postgresql.yml +0 -0
  178. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/services/s3.yml +0 -0
  179. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/solution.yml +0 -0
  180. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/coal/en-US/coal/web.yml +0 -0
  181. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech/translation/csm_data/__init__.py +0 -0
  182. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/dependency_links.txt +0 -0
  183. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/entry_points.txt +0 -0
  184. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/not-zip-safe +0 -0
  185. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/cosmotech_acceleration_library.egg-info/top_level.txt +0 -0
  186. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/requirements.all.txt +0 -0
  187. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/requirements.extra.txt +0 -0
  188. {cosmotech_acceleration_library-1.0.0 → cosmotech_acceleration_library-1.1.0}/requirements.test.txt +0 -0
  189. {cosmotech_acceleration_library-1.0.0 → 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.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,17 +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: redis==4.4.4
19
- Requires-Dist: redisgraph_bulk_loader==0.10.2
20
- Requires-Dist: cosmotech-api~=3.2
18
+ Requires-Dist: cosmotech-api>=3.2
21
19
  Requires-Dist: boto3~=1.35.19
22
20
  Requires-Dist: requests~=2.32.3
23
21
  Requires-Dist: singlestoredb~=1.10.0
24
22
  Requires-Dist: cosmotech-run-orchestrator~=2.0.0
25
- Requires-Dist: pyarrow~=17.0.0
26
- Requires-Dist: adbc-driver-manager~=1.1.0
27
- Requires-Dist: adbc-driver-sqlite~=1.1.0
28
- Requires-Dist: adbc-driver-postgresql~=1.1.0
23
+ Requires-Dist: pyarrow~=20.0.0
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
29
27
  Requires-Dist: click~=8.1.7
30
28
  Requires-Dist: rich-click~=1.7.3
31
29
  Requires-Dist: click-log~=0.4.0
@@ -36,18 +34,17 @@ Requires-Dist: python-dateutil~=2.8
36
34
  Requires-Dist: rich~=13.7
37
35
  Requires-Dist: setuptools
38
36
  Provides-Extra: doc
39
- Requires-Dist: mkdocs~=1.5.3; extra == "doc"
37
+ Requires-Dist: mkdocs~=1.6.1; extra == "doc"
40
38
  Requires-Dist: mkdocs-click~=0.8.1; extra == "doc"
41
39
  Requires-Dist: mkdocs-gen-files~=0.5.0; extra == "doc"
42
40
  Requires-Dist: mkdocstrings[python]~=0.28.2; extra == "doc"
43
- Requires-Dist: mkdocs-awesome-pages-plugin~=2.9.3; extra == "doc"
41
+ Requires-Dist: mkdocs-awesome-nav~=3.1.2; extra == "doc"
44
42
  Requires-Dist: pymdown-extensions~=10.7; extra == "doc"
45
43
  Requires-Dist: requirements-parser~=0.11.0; extra == "doc"
46
- Requires-Dist: setuptools~=70.3.0; extra == "doc"
47
44
  Requires-Dist: mike~=2.0.0; extra == "doc"
48
45
  Requires-Dist: griffe~=1.5.7; extra == "doc"
49
46
  Requires-Dist: mkdocs-include-dir-to-nav~=1.2.0; extra == "doc"
50
- Requires-Dist: mkdocs-material[imaging]~=9.5.18; extra == "doc"
47
+ Requires-Dist: mkdocs-material[imaging]~=9.6.14; extra == "doc"
51
48
  Requires-Dist: mkdocs-table-reader-plugin~=2.0.3; extra == "doc"
52
49
  Requires-Dist: mkdocs-literate-nav~=0.6.1; extra == "doc"
53
50
  Provides-Extra: test
@@ -57,10 +54,12 @@ Requires-Dist: pytest-cov; extra == "test"
57
54
  Provides-Extra: extra
58
55
  Requires-Dist: pandas~=2.2.2; extra == "extra"
59
56
  Provides-Extra: dev
60
- Requires-Dist: black==23.3.0; extra == "dev"
61
- Requires-Dist: pre-commit==3.3.2; extra == "dev"
57
+ Requires-Dist: black~=24.3.0; extra == "dev"
58
+ Requires-Dist: pre-commit~=3.3.2; extra == "dev"
62
59
  Provides-Extra: all
63
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"
64
63
  Dynamic: license-file
65
64
 
66
65
  # CosmoTech-Acceleration-Library (CoAL)
@@ -5,4 +5,4 @@
5
5
  # etc., to any person is prohibited unless it has been previously and
6
6
  # specifically authorized by written means by Cosmo Tech.
7
7
 
8
- __version__ = "1.0.0"
8
+ __version__ = "1.1.0"
@@ -160,9 +160,7 @@ def insert_csv_files(
160
160
  color = (
161
161
  "red"
162
162
  if status == IngestionStatus.FAILURE
163
- else "green"
164
- if status == IngestionStatus.SUCCESS
165
- else "bright_black"
163
+ else "green" if status == IngestionStatus.SUCCESS else "bright_black"
166
164
  )
167
165
  LOGGER.info(
168
166
  T("coal.services.adx.status_report").format(table=ingestion_ids[_id], status=status.name, color=color)
@@ -16,12 +16,16 @@ from cosmotech.coal.cosmotech_api.parameters import (
16
16
  write_parameters,
17
17
  )
18
18
 
19
- # Re-export functions from the twin_data_layer module
20
- from cosmotech.coal.cosmotech_api.twin_data_layer import (
21
- get_dataset_id_from_runner,
22
- send_files_to_tdl,
23
- load_files_from_tdl,
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, List, Any, Optional, Union, Tuple
11
+ from typing import Dict, Any, Optional, Union, Tuple
12
12
 
13
- from cosmotech_api import (
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(query="MATCH(n)-[r]->(m) RETURN n as src, r as rel, m as dest")
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, Tuple
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
- credentials: Optional[DefaultAzureCredential] = None,
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=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, credentials, return_dict, error_dict),
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