cosmotech-acceleration-library 1.0.1__tar.gz → 2.0.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 (211) hide show
  1. {cosmotech_acceleration_library-1.0.1/cosmotech_acceleration_library.egg-info → cosmotech_acceleration_library-2.0.0}/PKG-INFO +8 -9
  2. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/__init__.py +1 -1
  3. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/aws/__init__.py +1 -9
  4. cosmotech_acceleration_library-2.0.0/cosmotech/coal/aws/s3.py +202 -0
  5. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/auth.py +2 -2
  6. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/runner.py +13 -14
  7. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/store.py +5 -86
  8. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/tables.py +2 -2
  9. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/blob.py +6 -6
  10. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/storage.py +3 -3
  11. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/__init__.py +12 -0
  12. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/__init__.py +14 -0
  13. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/dataset.py +103 -0
  14. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/meta.py +25 -0
  15. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/organization.py +24 -0
  16. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/run.py +38 -0
  17. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/runner.py +71 -0
  18. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/solution.py +23 -0
  19. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/apis/workspace.py +108 -0
  20. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/objects/__init__.py +9 -0
  21. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/objects/connection.py +125 -0
  22. cosmotech_acceleration_library-2.0.0/cosmotech/coal/cosmotech_api/objects/parameters.py +127 -0
  23. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/postgresql/runner.py +56 -36
  24. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/postgresql/store.py +60 -14
  25. cosmotech_acceleration_library-2.0.0/cosmotech/coal/postgresql/utils.py +254 -0
  26. cosmotech_acceleration_library-2.0.0/cosmotech/coal/store/output/__init__.py +0 -0
  27. cosmotech_acceleration_library-2.0.0/cosmotech/coal/store/output/aws_channel.py +73 -0
  28. cosmotech_acceleration_library-2.0.0/cosmotech/coal/store/output/az_storage_channel.py +42 -0
  29. cosmotech_acceleration_library-2.0.0/cosmotech/coal/store/output/channel_interface.py +23 -0
  30. cosmotech_acceleration_library-2.0.0/cosmotech/coal/store/output/channel_spliter.py +55 -0
  31. cosmotech_acceleration_library-2.0.0/cosmotech/coal/store/output/postgres_channel.py +40 -0
  32. cosmotech_acceleration_library-2.0.0/cosmotech/coal/utils/configuration.py +169 -0
  33. cosmotech_acceleration_library-2.0.0/cosmotech/coal/utils/decorator.py +22 -0
  34. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/api/api.py +6 -19
  35. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/api/postgres_send_runner_metadata.py +20 -16
  36. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/api/run_load_data.py +7 -46
  37. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/api/wsf_load_file.py +14 -15
  38. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/api/wsf_send_file.py +12 -13
  39. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/s3_bucket_delete.py +16 -15
  40. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/s3_bucket_download.py +16 -16
  41. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/s3_bucket_upload.py +16 -14
  42. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/dump_to_s3.py +18 -16
  43. cosmotech_acceleration_library-2.0.0/cosmotech/csm_data/commands/store/output.py +35 -0
  44. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/store.py +3 -4
  45. cosmotech_acceleration_library-2.0.0/cosmotech/translation/coal/en-US/coal/cosmotech_api/initialization.yml +8 -0
  46. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/dataset.yml +4 -14
  47. cosmotech_acceleration_library-2.0.0/cosmotech/translation/coal/en-US/coal/store/output/data_interface.yml +1 -0
  48. cosmotech_acceleration_library-2.0.0/cosmotech/translation/coal/en-US/coal/store/output/split.yml +6 -0
  49. cosmotech_acceleration_library-2.0.0/cosmotech/translation/coal/en-US/coal/utils/configuration.yml +2 -0
  50. cosmotech_acceleration_library-2.0.0/cosmotech/translation/csm_data/en-US/csm_data/commands/store/output.yml +7 -0
  51. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0/cosmotech_acceleration_library.egg-info}/PKG-INFO +8 -9
  52. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech_acceleration_library.egg-info/SOURCES.txt +26 -43
  53. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech_acceleration_library.egg-info/requires.txt +7 -9
  54. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/pyproject.toml +4 -2
  55. cosmotech_acceleration_library-2.0.0/requirements.all.txt +1 -0
  56. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/requirements.dev.txt +1 -0
  57. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/requirements.txt +6 -5
  58. cosmotech_acceleration_library-1.0.1/cosmotech/coal/aws/s3.py +0 -235
  59. cosmotech_acceleration_library-1.0.1/cosmotech/coal/azure/functions.py +0 -72
  60. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/__init__.py +0 -36
  61. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/connection.py +0 -96
  62. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/__init__.py +0 -26
  63. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/converters.py +0 -164
  64. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/download/__init__.py +0 -19
  65. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/download/adt.py +0 -119
  66. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/download/common.py +0 -140
  67. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/download/file.py +0 -216
  68. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/download/twingraph.py +0 -188
  69. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/dataset/utils.py +0 -132
  70. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/parameters.py +0 -48
  71. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/run.py +0 -25
  72. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/run_data.py +0 -173
  73. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/run_template.py +0 -108
  74. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/runner/__init__.py +0 -28
  75. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/runner/data.py +0 -38
  76. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/runner/datasets.py +0 -364
  77. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/runner/download.py +0 -146
  78. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/runner/metadata.py +0 -42
  79. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/runner/parameters.py +0 -157
  80. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/twin_data_layer.py +0 -512
  81. cosmotech_acceleration_library-1.0.1/cosmotech/coal/cosmotech_api/workspace.py +0 -127
  82. cosmotech_acceleration_library-1.0.1/cosmotech/coal/utils/api.py +0 -68
  83. cosmotech_acceleration_library-1.0.1/cosmotech/coal/utils/postgresql.py +0 -236
  84. cosmotech_acceleration_library-1.0.1/cosmotech/csm_data/commands/api/rds_load_csv.py +0 -90
  85. cosmotech_acceleration_library-1.0.1/cosmotech/csm_data/commands/api/rds_send_csv.py +0 -74
  86. cosmotech_acceleration_library-1.0.1/cosmotech/csm_data/commands/api/rds_send_store.py +0 -74
  87. cosmotech_acceleration_library-1.0.1/cosmotech/csm_data/commands/api/runtemplate_load_handler.py +0 -66
  88. cosmotech_acceleration_library-1.0.1/cosmotech/csm_data/commands/api/tdl_load_files.py +0 -76
  89. cosmotech_acceleration_library-1.0.1/cosmotech/csm_data/commands/api/tdl_send_files.py +0 -82
  90. cosmotech_acceleration_library-1.0.1/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_load_csv.json +0 -27
  91. cosmotech_acceleration_library-1.0.1/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_send_csv.json +0 -27
  92. cosmotech_acceleration_library-1.0.1/cosmotech/orchestrator_plugins/csm-data/templates/api/rds_send_store.json +0 -27
  93. cosmotech_acceleration_library-1.0.1/cosmotech/orchestrator_plugins/csm-data/templates/api/runtemplate_load_handler.json +0 -27
  94. cosmotech_acceleration_library-1.0.1/cosmotech/orchestrator_plugins/csm-data/templates/api/tdl_load_files.json +0 -32
  95. cosmotech_acceleration_library-1.0.1/cosmotech/orchestrator_plugins/csm-data/templates/api/tdl_send_files.json +0 -27
  96. cosmotech_acceleration_library-1.0.1/cosmotech/translation/coal/en-US/coal/cosmotech_api/run_data.yml +0 -2
  97. cosmotech_acceleration_library-1.0.1/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_load_csv.yml +0 -13
  98. cosmotech_acceleration_library-1.0.1/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_csv.yml +0 -12
  99. cosmotech_acceleration_library-1.0.1/cosmotech/translation/csm_data/en-US/csm_data/commands/api/rds_send_store.yml +0 -12
  100. cosmotech_acceleration_library-1.0.1/cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_load_files.yml +0 -14
  101. cosmotech_acceleration_library-1.0.1/cosmotech/translation/csm_data/en-US/csm_data/commands/api/tdl_send_files.yml +0 -18
  102. cosmotech_acceleration_library-1.0.1/requirements.all.txt +0 -1
  103. cosmotech_acceleration_library-1.0.1/requirements.extra.txt +0 -2
  104. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/LICENSE +0 -0
  105. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/MANIFEST.in +0 -0
  106. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/README.md +0 -0
  107. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/__init__.py +0 -0
  108. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/__init__.py +0 -0
  109. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/ingestion.py +0 -0
  110. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/query.py +0 -0
  111. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/azure/adx/utils.py +0 -0
  112. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/csm/__init__.py +0 -0
  113. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/csm/engine/__init__.py +0 -0
  114. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/postgresql/__init__.py +0 -0
  115. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/singlestore/__init__.py +0 -0
  116. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/singlestore/store.py +0 -0
  117. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/store/__init__.py +0 -0
  118. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/store/csv.py +0 -0
  119. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/store/native_python.py +0 -0
  120. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/store/pandas.py +0 -0
  121. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/store/pyarrow.py +0 -0
  122. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/store/store.py +0 -0
  123. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/utils/__init__.py +0 -0
  124. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/coal/utils/logger.py +0 -0
  125. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/__init__.py +0 -0
  126. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/__init__.py +0 -0
  127. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/adx_send_data.py +0 -0
  128. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/adx_send_runnerdata.py +0 -0
  129. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/api/__init__.py +0 -0
  130. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/az_storage_upload.py +0 -0
  131. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/__init__.py +0 -0
  132. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/dump_to_azure.py +0 -0
  133. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/dump_to_postgresql.py +0 -0
  134. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/list_tables.py +0 -0
  135. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/load_csv_folder.py +0 -0
  136. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/load_from_singlestore.py +0 -0
  137. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/commands/store/reset.py +0 -0
  138. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/main.py +0 -0
  139. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/utils/__init__.py +0 -0
  140. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/utils/click.py +0 -0
  141. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/csm_data/utils/decorators.py +0 -0
  142. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/__init__.py +0 -0
  143. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/postgres_send_runner_metadata.json +0 -0
  144. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/run_load_data.json +0 -0
  145. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/try_api_connection.json +0 -0
  146. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/wsf_load_file.json +0 -0
  147. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/api/wsf_send_file.json +0 -0
  148. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/adx_send_runnerdata.json +0 -0
  149. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/az_storage_upload.json +0 -0
  150. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_delete.json +0 -0
  151. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_download.json +0 -0
  152. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/main/s3_bucket_upload.json +0 -0
  153. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_azure.json +0 -0
  154. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_postgresql.json +0 -0
  155. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_dump_to_s3.json +0 -0
  156. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_list_tables.json +0 -0
  157. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_load_csv_folder.json +0 -0
  158. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_load_from_singlestore.json +0 -0
  159. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/orchestrator_plugins/csm-data/templates/store/store_reset.json +0 -0
  160. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/__init__.py +0 -0
  161. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/common/data_transfer.yml +0 -0
  162. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/common/errors.yml +0 -0
  163. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/common/file_operations.yml +0 -0
  164. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/common/progress.yml +0 -0
  165. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/common/timing.yml +0 -0
  166. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/common/validation.yml +0 -0
  167. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/connection.yml +0 -0
  168. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/run_template.yml +0 -0
  169. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/runner.yml +0 -0
  170. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/solution.yml +0 -0
  171. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/cosmotech_api/workspace.yml +0 -0
  172. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/adx.yml +0 -0
  173. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/api.yml +0 -0
  174. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/azure_storage.yml +0 -0
  175. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/database.yml +0 -0
  176. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/postgresql.yml +0 -0
  177. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/services/s3.yml +0 -0
  178. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/solution.yml +0 -0
  179. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/coal/en-US/coal/web.yml +0 -0
  180. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/__init__.py +0 -0
  181. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/api.yml +0 -0
  182. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/postgres_send_runner_metadata.yml +0 -0
  183. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/run_load_data.yml +0 -0
  184. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/runtemplate_load_handler.yml +0 -0
  185. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_load_file.yml +0 -0
  186. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/api/wsf_send_file.yml +0 -0
  187. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/main.yml +0 -0
  188. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_data.yml +0 -0
  189. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/adx_send_runnerdata.yml +0 -0
  190. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/az_storage_upload.yml +0 -0
  191. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_delete.yml +0 -0
  192. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_download.yml +0 -0
  193. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/s3_bucket_upload.yml +0 -0
  194. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/storage/storage.yml +0 -0
  195. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_azure.yml +0 -0
  196. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_postgresql.yml +0 -0
  197. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/dump_to_s3.yml +0 -0
  198. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/list_tables.yml +0 -0
  199. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_csv_folder.yml +0 -0
  200. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/load_from_singlestore.yml +0 -0
  201. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/reset.yml +0 -0
  202. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commands/store/store.yml +0 -0
  203. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commons/decorators.yml +0 -0
  204. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech/translation/csm_data/en-US/csm_data/commons/version.yml +0 -0
  205. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech_acceleration_library.egg-info/dependency_links.txt +0 -0
  206. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech_acceleration_library.egg-info/entry_points.txt +0 -0
  207. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech_acceleration_library.egg-info/not-zip-safe +0 -0
  208. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/cosmotech_acceleration_library.egg-info/top_level.txt +0 -0
  209. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/requirements.doc.txt +0 -0
  210. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.0}/requirements.test.txt +0 -0
  211. {cosmotech_acceleration_library-1.0.1 → cosmotech_acceleration_library-2.0.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.1
3
+ Version: 2.0.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,21 +15,21 @@ 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~=3.2
18
+ Requires-Dist: cosmotech-api~=5.0.0rc1
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.1.0
25
- Requires-Dist: adbc-driver-sqlite~=1.1.0
26
- Requires-Dist: adbc-driver-postgresql~=1.1.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
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
30
30
  Requires-Dist: tqdm~=4.67.1
31
31
  Requires-Dist: openpyxl~=3.1
32
- Requires-Dist: pandas~=2.1
32
+ Requires-Dist: pandas~=2.3
33
33
  Requires-Dist: python-dateutil~=2.8
34
34
  Requires-Dist: rich~=13.7
35
35
  Requires-Dist: setuptools
@@ -51,13 +51,12 @@ Provides-Extra: test
51
51
  Requires-Dist: pytest; extra == "test"
52
52
  Requires-Dist: pytest-docker; extra == "test"
53
53
  Requires-Dist: pytest-cov; extra == "test"
54
- Provides-Extra: extra
55
- Requires-Dist: pandas~=2.2.2; extra == "extra"
56
54
  Provides-Extra: dev
57
55
  Requires-Dist: black~=24.3.0; extra == "dev"
58
56
  Requires-Dist: pre-commit~=3.3.2; extra == "dev"
57
+ Requires-Dist: isort~=7.0.0; extra == "dev"
59
58
  Provides-Extra: all
60
- Requires-Dist: CosmoTech_Acceleration_Library[dev,doc,extra,test]; extra == "all"
59
+ Requires-Dist: CosmoTech_Acceleration_Library[dev,doc,test]; extra == "all"
61
60
  Dynamic: license-file
62
61
 
63
62
  # 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.1"
8
+ __version__ = "2.0.0"
@@ -12,12 +12,4 @@ This module provides functions for interacting with AWS services like S3.
12
12
  """
13
13
 
14
14
  # Re-export S3 functions for easier importing
15
- from cosmotech.coal.aws.s3 import (
16
- create_s3_client,
17
- create_s3_resource,
18
- upload_file,
19
- upload_folder,
20
- download_files,
21
- upload_data_stream,
22
- delete_objects,
23
- )
15
+ from cosmotech.coal.aws.s3 import S3
@@ -0,0 +1,202 @@
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
+ """
9
+ s3 bucket operations module.
10
+
11
+ this module provides functions for interacting with S3 buckets, including
12
+ uploading, downloading, and deleting files.
13
+ """
14
+
15
+ import pathlib
16
+ from io import BytesIO
17
+
18
+ import boto3
19
+ from cosmotech.orchestrator.utils.translate import T
20
+
21
+ from cosmotech.coal.utils.configuration import Configuration
22
+ from cosmotech.coal.utils.logger import LOGGER
23
+
24
+
25
+ class S3:
26
+
27
+ def __init__(self, configuration: Configuration):
28
+ self._configuration = configuration.s3
29
+
30
+ @property
31
+ def file_prefix(self):
32
+ if "bucket_prefix" in self._configuration:
33
+ return self._configuration.bucket_prefix
34
+ return ""
35
+
36
+ @property
37
+ def use_ssl(self):
38
+ if "use_ssl" in self._configuration:
39
+ return self._configuration.use_ssl
40
+ return True
41
+
42
+ @property
43
+ def ssl_cert_bundle(self):
44
+ if "ssl_cert_bundle" in self._configuration:
45
+ return self._configuration.ssl_cert_bundle
46
+ return None
47
+
48
+ @property
49
+ def access_key_id(self):
50
+ return self._configuration.access_key_id
51
+
52
+ @property
53
+ def endpoint_url(self):
54
+ return self._configuration.endpoint_url
55
+
56
+ @property
57
+ def bucket_name(self):
58
+ return self._configuration.bucket_name
59
+
60
+ @property
61
+ def secret_access_key(self):
62
+ return self._configuration.secret_access_key
63
+
64
+ @property
65
+ def output_type(self):
66
+ if "output_type" in self._configuration:
67
+ return self._configuration.output_type
68
+ return "csv"
69
+
70
+ @property
71
+ def client(self) -> boto3.client:
72
+ boto3_parameters = {
73
+ "use_ssl": self.use_ssl,
74
+ "endpoint_url": self.endpoint_url,
75
+ "aws_access_key_id": self.access_key_id,
76
+ "aws_secret_access_key": self.secret_access_key,
77
+ }
78
+ if self.ssl_cert_bundle:
79
+ boto3_parameters["verify"] = self.ssl_cert_bundle
80
+
81
+ return boto3.client("s3", **boto3_parameters)
82
+
83
+ @property
84
+ def resource(self) -> boto3.resource:
85
+ boto3_parameters = {
86
+ "use_ssl": self.use_ssl,
87
+ "endpoint_url": self.endpoint_url,
88
+ "aws_access_key_id": self.access_key_id,
89
+ "aws_secret_access_key": self.secret_access_key,
90
+ }
91
+ if self.ssl_cert_bundle:
92
+ boto3_parameters["verify"] = self.ssl_cert_bundle
93
+
94
+ return boto3.resource("s3", **boto3_parameters)
95
+
96
+ def upload_file(self, file_path: pathlib.Path) -> None:
97
+ """
98
+ Upload a single file to an S3 bucket.
99
+
100
+ Args:
101
+ file_path: Path to the file to upload
102
+ """
103
+ uploaded_file_name = self.file_prefix + file_path.name
104
+ LOGGER.info(
105
+ T("coal.common.data_transfer.file_sent").format(file_path=file_path, uploaded_name=uploaded_file_name)
106
+ )
107
+ self.resource.Bucket(self.bucket_name).upload_file(str(file_path), uploaded_file_name)
108
+
109
+ def upload_folder(self, source_folder: str, recursive: bool = False) -> None:
110
+ """
111
+ Upload files from a folder to an S3 bucket.
112
+
113
+ Args:
114
+ source_folder: Path to the folder containing files to upload
115
+ recursive: Whether to recursively upload files from subdirectories
116
+ """
117
+ source_path = pathlib.Path(source_folder)
118
+ if not source_path.exists():
119
+ LOGGER.error(T("coal.common.file_operations.not_found").format(source_folder=source_folder))
120
+ raise FileNotFoundError(T("coal.common.file_operations.not_found").format(source_folder=source_folder))
121
+
122
+ if source_path.is_dir():
123
+ _source_name = str(source_path)
124
+ for _file_path in source_path.glob("**/*" if recursive else "*"):
125
+ if _file_path.is_file():
126
+ _file_name = str(_file_path).removeprefix(_source_name).removeprefix("/")
127
+ uploaded_file_name = self.file_prefix + _file_name
128
+ LOGGER.info(
129
+ T("coal.common.data_transfer.file_sent").format(
130
+ file_path=_file_path, uploaded_name=uploaded_file_name
131
+ )
132
+ )
133
+ self.resource.Bucket(self.bucket_name).upload_file(str(_file_path), uploaded_file_name)
134
+ else:
135
+ self.upload_file(source_path)
136
+
137
+ def download_files(self, destination_folder: str) -> None:
138
+ """
139
+ Download files from an S3 bucket to a local folder.
140
+
141
+ Args:
142
+ destination_folder: Local folder to download files to
143
+ """
144
+ bucket = self.resource.Bucket(self.bucket_name)
145
+
146
+ pathlib.Path(destination_folder).mkdir(parents=True, exist_ok=True)
147
+ remove_prefix = False
148
+ if self.file_prefix:
149
+ bucket_files = bucket.objects.filter(Prefix=self.file_prefix)
150
+ if self.file_prefix.endswith("/"):
151
+ remove_prefix = True
152
+ else:
153
+ bucket_files = bucket.objects.all()
154
+ for _file in bucket_files:
155
+ if not (path_name := str(_file.key)).endswith("/"):
156
+ target_file = path_name
157
+ if remove_prefix:
158
+ target_file = target_file.removeprefix(self.file_prefix)
159
+ output_file = f"{destination_folder}/{target_file}"
160
+ pathlib.Path(output_file).parent.mkdir(parents=True, exist_ok=True)
161
+ LOGGER.info(T("coal.services.azure_storage.downloading").format(path=path_name, output=output_file))
162
+ bucket.download_file(_file.key, output_file)
163
+
164
+ def upload_data_stream(self, data_stream: BytesIO, file_name: str) -> None:
165
+ """
166
+ Upload a data stream to an S3 bucket.
167
+
168
+ Args:
169
+ data_stream: BytesIO stream containing the data to upload
170
+ file_name: Name of the file to create in the bucket
171
+ """
172
+ uploaded_file_name = self.file_prefix + file_name
173
+ data_stream.seek(0)
174
+ size = len(data_stream.read())
175
+ data_stream.seek(0)
176
+
177
+ LOGGER.info(T("coal.common.data_transfer.sending_data").format(size=size))
178
+ self.client.upload_fileobj(data_stream, self.bucket_name, uploaded_file_name)
179
+
180
+ def delete_objects(self) -> None:
181
+ """
182
+ Delete objects from an S3 bucket, optionally filtered by prefix.
183
+
184
+ Args:
185
+ bucket_name: Name of the S3 bucket
186
+ s3_resource: S3 resource object
187
+ file_prefix: Optional prefix to filter objects to delete
188
+ """
189
+ bucket = self.resource.Bucket(self.bucket_name)
190
+
191
+ if self.file_prefix:
192
+ bucket_files = bucket.objects.filter(Prefix=self.file_prefix)
193
+ else:
194
+ bucket_files = bucket.objects.all()
195
+
196
+ boto_objects = [{"Key": _file.key} for _file in bucket_files if _file.key != self.file_prefix]
197
+ if boto_objects:
198
+ LOGGER.info(T("coal.services.azure_storage.deleting_objects").format(objects=boto_objects))
199
+ boto_delete_request = {"Objects": boto_objects}
200
+ bucket.delete_objects(Delete=boto_delete_request)
201
+ else:
202
+ LOGGER.info(T("coal.services.azure_storage.no_objects"))
@@ -6,13 +6,13 @@
6
6
  # specifically authorized by written means by Cosmo Tech.
7
7
 
8
8
  import os
9
- from typing import Union, Optional, Tuple
9
+ from typing import Optional, Tuple
10
10
 
11
11
  from azure.kusto.data import KustoClient, KustoConnectionStringBuilder
12
12
  from azure.kusto.ingest import QueuedIngestClient
13
+ from cosmotech.orchestrator.utils.translate import T
13
14
 
14
15
  from cosmotech.coal.utils.logger import LOGGER
15
- from cosmotech.orchestrator.utils.translate import T
16
16
 
17
17
 
18
18
  def create_kusto_client(
@@ -13,25 +13,24 @@ This module provides functions for ingesting runner data into Azure Data Explore
13
13
 
14
14
  import pathlib
15
15
  import time
16
- from collections import defaultdict
17
- from typing import Dict, Any, List, Tuple, Optional
16
+ from typing import Any, Dict
18
17
 
19
18
  from azure.kusto.data.response import KustoResponseDataSet
20
- from azure.kusto.ingest import ColumnMapping
21
- from azure.kusto.ingest import FileDescriptor
22
- from azure.kusto.ingest import IngestionMappingKind
23
- from azure.kusto.ingest import IngestionProperties
24
- from azure.kusto.ingest import IngestionResult
25
- from azure.kusto.ingest import ReportLevel
26
-
27
- from azure.kusto.data import KustoClient
28
- from azure.kusto.ingest import QueuedIngestClient
19
+ from azure.kusto.ingest import (
20
+ ColumnMapping,
21
+ FileDescriptor,
22
+ IngestionMappingKind,
23
+ IngestionProperties,
24
+ IngestionResult,
25
+ QueuedIngestClient,
26
+ ReportLevel,
27
+ )
28
+ from cosmotech.orchestrator.utils.translate import T
29
29
 
30
30
  from cosmotech.coal.azure.adx.auth import initialize_clients
31
- from cosmotech.coal.azure.adx.query import run_query, run_command_query
32
- from cosmotech.coal.azure.adx.ingestion import check_ingestion_status, IngestionStatus
31
+ from cosmotech.coal.azure.adx.ingestion import IngestionStatus, check_ingestion_status
32
+ from cosmotech.coal.azure.adx.query import run_query
33
33
  from cosmotech.coal.utils.logger import LOGGER
34
- from cosmotech.orchestrator.utils.translate import T
35
34
 
36
35
 
37
36
  def prepare_csv_content(folder_path: str) -> Dict[str, Dict[str, Any]]:
@@ -7,26 +7,22 @@
7
7
 
8
8
  import os
9
9
  import tempfile
10
+ import time
10
11
  import uuid
11
- from typing import Optional, List, Dict, Tuple, Union, Any
12
+ from typing import Any, Dict, List, Optional, Tuple, Union
12
13
 
13
14
  import pyarrow
14
15
  import pyarrow.csv as pc
15
- import time
16
16
  from azure.kusto.data import KustoClient
17
17
  from azure.kusto.data.data_format import DataFormat
18
- from azure.kusto.ingest import IngestionProperties
19
- from azure.kusto.ingest import QueuedIngestClient
20
- from azure.kusto.ingest import ReportLevel
18
+ from azure.kusto.ingest import IngestionProperties, QueuedIngestClient, ReportLevel
21
19
  from cosmotech.orchestrator.utils.translate import T
22
- from time import perf_counter
23
20
 
24
- from cosmotech.coal.azure.adx.tables import check_and_create_table, _drop_by_tag
25
21
  from cosmotech.coal.azure.adx.auth import initialize_clients
26
- from cosmotech.coal.azure.adx.ingestion import monitor_ingestion, handle_failures
22
+ from cosmotech.coal.azure.adx.ingestion import handle_failures, monitor_ingestion
23
+ from cosmotech.coal.azure.adx.tables import _drop_by_tag, check_and_create_table
27
24
  from cosmotech.coal.store.store import Store
28
25
  from cosmotech.coal.utils.logger import LOGGER
29
- from cosmotech.coal.utils.postgresql import send_pyarrow_table_to_postgresql
30
26
 
31
27
 
32
28
  def send_table_data(
@@ -176,80 +172,3 @@ def send_store_to_adx(
176
172
  LOGGER.warning(T("coal.services.adx.dropping_data").format(operation_tag=operation_tag))
177
173
  _drop_by_tag(kusto_client, database, operation_tag)
178
174
  raise e
179
-
180
-
181
- def dump_store_to_adx(
182
- store_folder: str,
183
- postgres_host: str,
184
- postgres_port: int,
185
- postgres_db: str,
186
- postgres_schema: str,
187
- postgres_user: str,
188
- postgres_password: str,
189
- table_prefix: str = "Cosmotech_",
190
- replace: bool = True,
191
- ) -> None:
192
- """
193
- Dump Store data to an Azure Data Explorer database.
194
-
195
- Args:
196
- store_folder: Folder containing the Store
197
- postgres_host: PostgreSQL host
198
- postgres_port: PostgreSQL port
199
- postgres_db: PostgreSQL database name
200
- postgres_schema: PostgreSQL schema
201
- postgres_user: PostgreSQL username
202
- postgres_password: PostgreSQL password
203
- table_prefix: Table prefix
204
- replace: Whether to replace existing tables
205
- """
206
- _s = Store(store_location=store_folder)
207
-
208
- tables = list(_s.list_tables())
209
- if len(tables):
210
- LOGGER.info(T("coal.services.database.sending_data").format(table=f"{postgres_db}.{postgres_schema}"))
211
- total_rows = 0
212
- _process_start = perf_counter()
213
- for table_name in tables:
214
- _s_time = perf_counter()
215
- target_table_name = f"{table_prefix}{table_name}"
216
- LOGGER.info(T("coal.services.database.table_entry").format(table=target_table_name))
217
- data = _s.get_table(table_name)
218
- if not len(data):
219
- LOGGER.info(T("coal.services.database.no_rows"))
220
- continue
221
- _dl_time = perf_counter()
222
- rows = send_pyarrow_table_to_postgresql(
223
- data,
224
- target_table_name,
225
- postgres_host,
226
- postgres_port,
227
- postgres_db,
228
- postgres_schema,
229
- postgres_user,
230
- postgres_password,
231
- replace,
232
- )
233
- total_rows += rows
234
- _up_time = perf_counter()
235
- LOGGER.info(T("coal.services.database.row_count").format(count=rows))
236
- LOGGER.debug(
237
- T("coal.common.timing.operation_completed").format(
238
- operation="Load from datastore", time=f"{_dl_time - _s_time:0.3}"
239
- )
240
- )
241
- LOGGER.debug(
242
- T("coal.common.timing.operation_completed").format(
243
- operation="Send to postgresql", time=f"{_up_time - _dl_time:0.3}"
244
- )
245
- )
246
- _process_end = perf_counter()
247
- LOGGER.info(
248
- T("coal.services.database.rows_fetched").format(
249
- table="all tables",
250
- count=total_rows,
251
- time=f"{_process_end - _process_start:0.3}",
252
- )
253
- )
254
- else:
255
- LOGGER.info(T("coal.services.database.store_empty"))
@@ -5,13 +5,13 @@
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
- from typing import Dict, Any
8
+ from typing import Dict
9
9
 
10
10
  import pyarrow
11
11
  from azure.kusto.data import KustoClient
12
+ from cosmotech.orchestrator.utils.translate import T
12
13
 
13
14
  from cosmotech.coal.utils.logger import LOGGER
14
- from cosmotech.orchestrator.utils.translate import T
15
15
 
16
16
 
17
17
  def table_exists(client: KustoClient, database: str, table_name: str) -> bool:
@@ -12,19 +12,16 @@ This module provides functions for interacting with Azure Blob Storage,
12
12
  including uploading data from the Store.
13
13
  """
14
14
 
15
- import pathlib
16
15
  from io import BytesIO
17
- from typing import List, Optional
18
-
19
- from azure.identity import ClientSecretCredential
20
- from azure.storage.blob import BlobServiceClient
21
16
 
22
17
  import pyarrow.csv as pc
23
18
  import pyarrow.parquet as pq
19
+ from azure.identity import ClientSecretCredential
20
+ from azure.storage.blob import BlobServiceClient
21
+ from cosmotech.orchestrator.utils.translate import T
24
22
 
25
23
  from cosmotech.coal.store.store import Store
26
24
  from cosmotech.coal.utils.logger import LOGGER
27
- from cosmotech.orchestrator.utils.translate import T
28
25
 
29
26
  VALID_TYPES = (
30
27
  "sqlite",
@@ -42,6 +39,7 @@ def dump_store_to_azure(
42
39
  client_secret: str,
43
40
  output_type: str = "sqlite",
44
41
  file_prefix: str = "",
42
+ selected_tables: list[str] = [],
45
43
  ) -> None:
46
44
  """
47
45
  Dump Store data to Azure Blob Storage.
@@ -90,6 +88,8 @@ def dump_store_to_azure(
90
88
  container_client.upload_blob(name=_uploaded_file_name, data=data, overwrite=True)
91
89
  else:
92
90
  tables = list(_s.list_tables())
91
+ if selected_tables:
92
+ tables = [t for t in tables if t in selected_tables]
93
93
  for table_name in tables:
94
94
  _data_stream = BytesIO()
95
95
  _file_name = None
@@ -15,9 +15,9 @@ uploading files to blob storage.
15
15
  import pathlib
16
16
 
17
17
  from azure.storage.blob import ContainerClient
18
+ from cosmotech.orchestrator.utils.translate import T
18
19
 
19
20
  from cosmotech.coal.utils.logger import LOGGER
20
- from cosmotech.orchestrator.utils.translate import T
21
21
 
22
22
 
23
23
  def upload_file(
@@ -65,10 +65,10 @@ def upload_folder(
65
65
  raise FileNotFoundError(T("coal.common.file_operations.not_found").format(source_folder=source_folder))
66
66
 
67
67
  if source_path.is_dir():
68
- _source_name = str(source_path)
68
+ # _source_name = str(source_path)
69
69
  for _file_path in source_path.glob("**/*" if recursive else "*"):
70
70
  if _file_path.is_file():
71
- _file_name = str(_file_path).removeprefix(_source_name).removeprefix("/")
71
+ # _file_name = str(_file_path).removeprefix(_source_name).removeprefix("/")
72
72
  upload_file(_file_path, blob_name, az_storage_sas_url, file_prefix)
73
73
  else:
74
74
  upload_file(source_path, blob_name, az_storage_sas_url, file_prefix)
@@ -0,0 +1,12 @@
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
+ """
9
+ Cosmotech API integration module.
10
+
11
+ This module provides functions for interacting with the Cosmotech API.
12
+ """
@@ -0,0 +1,14 @@
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
+ from cosmotech.coal.cosmotech_api.apis.dataset import DatasetApi
9
+ from cosmotech.coal.cosmotech_api.apis.meta import MetaApi
10
+ from cosmotech.coal.cosmotech_api.apis.organization import OrganizationApi
11
+ from cosmotech.coal.cosmotech_api.apis.run import RunApi
12
+ from cosmotech.coal.cosmotech_api.apis.runner import RunnerApi
13
+ from cosmotech.coal.cosmotech_api.apis.solution import SolutionApi
14
+ from cosmotech.coal.cosmotech_api.apis.workspace import WorkspaceApi
@@ -0,0 +1,103 @@
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
+ from pathlib import Path
8
+ from typing import Optional, Union
9
+
10
+ from cosmotech.orchestrator.utils.translate import T
11
+ from cosmotech_api import (
12
+ Dataset,
13
+ )
14
+ from cosmotech_api import DatasetApi as BaseDatasetApi
15
+ from cosmotech_api import (
16
+ DatasetCreateRequest,
17
+ DatasetPartCreateRequest,
18
+ DatasetPartTypeEnum,
19
+ )
20
+
21
+ from cosmotech.coal.cosmotech_api.objects.connection import Connection
22
+ from cosmotech.coal.utils.configuration import ENVIRONMENT_CONFIGURATION, Configuration
23
+ from cosmotech.coal.utils.logger import LOGGER
24
+
25
+
26
+ class DatasetApi(BaseDatasetApi, Connection):
27
+
28
+ def __init__(
29
+ self,
30
+ configuration: Configuration = ENVIRONMENT_CONFIGURATION,
31
+ ):
32
+ Connection.__init__(self, configuration)
33
+ BaseDatasetApi.__init__(self, self.api_client)
34
+
35
+ LOGGER.debug(T("coal.cosmotech_api.initialization.dataset_api_initialized"))
36
+
37
+ def download_dataset(self, dataset_id) -> Dataset:
38
+ dataset = self.get_dataset(
39
+ organization_id=self.configuration.cosmotech.organization_id,
40
+ workspace_id=self.configuration.cosmotech.workspace_id,
41
+ dataset_id=dataset_id,
42
+ )
43
+
44
+ dataset_dir = self.configuration.cosmotech.dataset_absolute_path
45
+ dataset_dir_path = Path(dataset_dir) / dataset_id
46
+ for part in dataset.parts:
47
+ part_file_path = dataset_dir_path / part.source_name
48
+ part_file_path.parent.mkdir(parents=True, exist_ok=True)
49
+ data_part = self.download_dataset_part(
50
+ organization_id=self.configuration.cosmotech.organization_id,
51
+ workspace_id=self.configuration.cosmotech.workspace_id,
52
+ dataset_id=dataset_id,
53
+ dataset_part_id=part.id,
54
+ )
55
+ with open(part_file_path, "wb") as binary_file:
56
+ binary_file.write(data_part)
57
+ LOGGER.debug(
58
+ T("coal.services.dataset.part_downloaded").format(part_name=part.source_name, file_path=part_file_path)
59
+ )
60
+ return dataset
61
+
62
+ @staticmethod
63
+ def path_to_parts(_path, part_type) -> list[tuple[str, Path, DatasetPartTypeEnum]]:
64
+ if (_path := Path(_path)).is_dir():
65
+ return list((str(_p.relative_to(_path)), _p, part_type) for _p in _path.rglob("*") if _p.is_file())
66
+ return list(((_path.name, _path, part_type),))
67
+
68
+ def upload_dataset(
69
+ self,
70
+ dataset_name: str,
71
+ as_files: Optional[list[Union[Path, str]]] = (),
72
+ as_db: Optional[list[Union[Path, str]]] = (),
73
+ ) -> Dataset:
74
+ _parts = list()
75
+
76
+ for _f in as_files:
77
+ _parts.extend(self.path_to_parts(_f, DatasetPartTypeEnum.FILE))
78
+
79
+ for _db in as_db:
80
+ _parts.extend(self.path_to_parts(_db, DatasetPartTypeEnum.DB))
81
+
82
+ d_request = DatasetCreateRequest(
83
+ name=dataset_name,
84
+ parts=list(
85
+ DatasetPartCreateRequest(
86
+ name=_p_name,
87
+ description=_p_name,
88
+ sourceName=_p_name,
89
+ type=_type,
90
+ )
91
+ for _p_name, _, _type in _parts
92
+ ),
93
+ )
94
+
95
+ d_ret = self.create_dataset(
96
+ self.configuration.cosmotech.organization_id,
97
+ self.configuration.cosmotech.workspace_id,
98
+ d_request,
99
+ files=list((_p[0], _p[1].open("rb").read()) for _p in _parts),
100
+ )
101
+
102
+ LOGGER.info(T("coal.services.dataset.dataset_created").format(dataset_id=d_ret.id))
103
+ return d_ret