mage-ai 0.9.74__py3-none-any.whl → 0.9.79__py3-none-any.whl

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 (420) hide show
  1. mage_ai/ai/llm_pipeline_wizard.py +6 -4
  2. mage_ai/ai/openai_client.py +7 -5
  3. mage_ai/api/policies/PipelineSchedulePolicy.py +1 -0
  4. mage_ai/api/presenters/PipelineSchedulePresenter.py +11 -2
  5. mage_ai/api/resources/GitFileResource.py +8 -0
  6. mage_ai/api/resources/PipelineScheduleResource.py +20 -14
  7. mage_ai/api/resources/PipelineTriggerResource.py +3 -1
  8. mage_ai/api/resources/SessionResource.py +2 -2
  9. mage_ai/api/resources/SyncResource.py +1 -1
  10. mage_ai/api/resources/UserResource.py +1 -1
  11. mage_ai/cli/main.py +8 -1
  12. mage_ai/data_cleaner/analysis/charts.py +1 -1
  13. mage_ai/data_cleaner/cleaning_rules/reformat_values.py +1 -1
  14. mage_ai/data_integrations/destinations/constants.py +3 -0
  15. mage_ai/data_integrations/sources/constants.py +2 -0
  16. mage_ai/data_preparation/executors/block_executor.py +8 -3
  17. mage_ai/data_preparation/executors/pipeline_executor.py +35 -19
  18. mage_ai/data_preparation/git/utils.py +2 -2
  19. mage_ai/data_preparation/logging/logger_manager.py +31 -2
  20. mage_ai/data_preparation/models/block/__init__.py +33 -27
  21. mage_ai/data_preparation/models/block/dbt/dbt_adapter.py +20 -8
  22. mage_ai/data_preparation/models/block/dynamic/constants.py +0 -1
  23. mage_ai/data_preparation/models/block/dynamic/counter.py +1 -3
  24. mage_ai/data_preparation/models/block/outputs.py +7 -1
  25. mage_ai/data_preparation/models/block/r/__init__.py +16 -5
  26. mage_ai/data_preparation/models/block/sql/__init__.py +2 -0
  27. mage_ai/data_preparation/models/block/sql/mssql.py +8 -0
  28. mage_ai/data_preparation/models/block/sql/utils/shared.py +6 -2
  29. mage_ai/data_preparation/models/constants.py +4 -1
  30. mage_ai/data_preparation/models/pipeline.py +11 -2
  31. mage_ai/data_preparation/models/project/__init__.py +3 -1
  32. mage_ai/data_preparation/models/triggers/__init__.py +1 -1
  33. mage_ai/data_preparation/storage/local_storage.py +4 -1
  34. mage_ai/data_preparation/templates/constants.py +7 -0
  35. mage_ai/data_preparation/templates/data_exporters/streaming/elasticsearch.yaml +3 -0
  36. mage_ai/data_preparation/templates/data_loaders/airtable.py +28 -0
  37. mage_ai/data_preparation/templates/data_loaders/streaming/nats.yaml +6 -3
  38. mage_ai/data_preparation/templates/repo/io_config.yaml +2 -0
  39. mage_ai/io/airtable.py +104 -0
  40. mage_ai/io/base.py +30 -1
  41. mage_ai/io/bigquery.py +36 -0
  42. mage_ai/io/config.py +6 -0
  43. mage_ai/io/mssql.py +21 -9
  44. mage_ai/io/mysql.py +6 -1
  45. mage_ai/io/oracledb.py +2 -4
  46. mage_ai/io/postgres.py +41 -19
  47. mage_ai/io/qdrant.py +1 -1
  48. mage_ai/io/redshift.py +13 -0
  49. mage_ai/io/sql.py +1 -0
  50. mage_ai/io/utils.py +18 -0
  51. mage_ai/orchestration/db/__init__.py +23 -3
  52. mage_ai/orchestration/db/migrations/versions/39d36f1dab73_create_genericjob.py +47 -0
  53. mage_ai/orchestration/db/models/oauth.py +2 -1
  54. mage_ai/orchestration/db/models/schedules.py +108 -6
  55. mage_ai/orchestration/db/models/schedules_project_platform.py +1 -1
  56. mage_ai/orchestration/db/models/secrets.py +11 -1
  57. mage_ai/orchestration/job_manager.py +19 -0
  58. mage_ai/orchestration/metrics/pipeline_run.py +1 -1
  59. mage_ai/orchestration/notification/sender.py +2 -2
  60. mage_ai/orchestration/pipeline_scheduler_original.py +150 -6
  61. mage_ai/orchestration/pipeline_scheduler_project_platform.py +4 -5
  62. mage_ai/orchestration/queue/config.py +11 -1
  63. mage_ai/orchestration/queue/process_queue.py +4 -0
  64. mage_ai/orchestration/utils/distributed_lock.py +8 -1
  65. mage_ai/orchestration/utils/resources.py +56 -2
  66. mage_ai/sample_datasets/salary_survey.csv +52 -52
  67. mage_ai/server/api/base.py +41 -0
  68. mage_ai/server/api/constants.py +1 -0
  69. mage_ai/server/api/triggers.py +9 -0
  70. mage_ai/server/constants.py +1 -1
  71. mage_ai/server/frontend_dist/404.html +3 -3
  72. mage_ai/server/frontend_dist/_next/static/TUo4RceCdMufBTBTq8CAq/_buildManifest.js +1 -0
  73. mage_ai/server/frontend_dist/_next/static/chunks/{1187-839336d276186105.js → 1187-4560c3895e1d7099.js} +1 -1
  74. mage_ai/server/frontend_dist/_next/static/chunks/{1598-0adca9dce3ba4c60.js → 1598-cbf3f5a6078fc3f5.js} +1 -1
  75. mage_ai/server/frontend_dist/_next/static/chunks/2717-638a944d24d5abde.js +1 -0
  76. mage_ai/server/frontend_dist/_next/static/chunks/3548-36f746b1824004f2.js +1 -0
  77. mage_ai/server/frontend_dist/_next/static/chunks/{3763-39a5174f6a3924db.js → 3763-aabe2703076636b0.js} +1 -1
  78. mage_ai/server/frontend_dist/_next/static/chunks/3782-3e2acb5ed45b582b.js +1 -0
  79. mage_ai/server/frontend_dist/_next/static/chunks/449-5e2253c6aba42557.js +1 -0
  80. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/5627-d5e559859dd0e1e0.js → frontend_dist/_next/static/chunks/5627-10e76bafa5a26f5f.js} +1 -1
  81. mage_ai/server/frontend_dist/_next/static/chunks/{5699-e49718dfc9eb2854.js → 5699-e99379e332bd0b41.js} +1 -1
  82. mage_ai/server/frontend_dist/_next/static/chunks/{7966-163da2621b8c987c.js → 7966-a5a7db345ce81263.js} +1 -1
  83. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-b697b35dfc4e6e26.js +2 -0
  84. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/compute-ed67fa8e81662e8b.js → frontend_dist/_next/static/chunks/pages/compute-9e2dea78024e3bb4.js} +1 -1
  85. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/files-e0ecd7ced09a63b2.js → frontend_dist/_next/static/chunks/pages/files-e08c7fe76f968f9c.js} +1 -1
  86. mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/{[...slug]-c7a729477ecda50e.js → [...slug]-30c3807057a4e65b.js} +1 -1
  87. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-data-products-fd6ae6a358a60a0c.js → global-data-products-8dcb3b31af9e0e39.js} +1 -1
  88. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-8e50243797a7fe59.js → frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-85a64b64d27214b6.js} +1 -1
  89. mage_ai/server/frontend_dist/_next/static/chunks/pages/{global-hooks-d0c003446332dc0d.js → global-hooks-4ff959d51b8a9502.js} +1 -1
  90. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{files-a69ed8e9f814490c.js → files-d08a460641d0efaa.js} +1 -1
  91. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{overview-1aad7093c6d39257.js → overview-aae747f487e08d51.js} +1 -1
  92. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{pipeline-runs-528d30e0d13b0cc7.js → pipeline-runs-09a842d64a6ada62.js} +1 -1
  93. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{settings-fb9201d9cf63031d.js → settings-2e98e57d9376a458.js} +1 -1
  94. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/{[user]-000f5a980a07da39.js → [user]-7be6e41ad66089bb.js} +1 -1
  95. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-e4e613f6e817a733.js → frontend_dist/_next/static/chunks/pages/manage/users/new-4c088833063bfa07.js} +1 -1
  96. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-5db54821a3059c69.js +1 -0
  97. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/manage-34d718b8a4066c23.js → frontend_dist/_next/static/chunks/pages/manage-868fcd8cbeb265f0.js} +1 -1
  98. mage_ai/server/frontend_dist/_next/static/chunks/pages/{oauth-3bfd1b8d7f036726.js → oauth-6ceceb62191dfe8a.js} +1 -1
  99. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-f65416f6dbe30ad3.js +1 -0
  100. mage_ai/server/frontend_dist/_next/static/chunks/pages/{pipeline-runs-5f8c100e648efa8a.js → pipeline-runs-2d0136b51b57de93.js} +1 -1
  101. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-688c652f3296bb9c.js → [...slug]-1ad5238742e25b4c.js} +1 -1
  102. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bd11e87d026bfbf9.js +1 -0
  103. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-1236e36d39b1637d.js → dashboard-0f4f47f721b0723f.js} +1 -1
  104. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-5ae8efe9e0530212.js +1 -0
  105. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-fe91dfb0091f6bc6.js +1 -0
  106. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-0d68d4bf6290fefb.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-cf794b2d22a80f31.js} +1 -1
  107. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-9254358d58f07714.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-a964caef91bed9e1.js} +1 -1
  108. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-821001e690caebe2.js → monitors-80bebb4401eefe25.js} +1 -1
  109. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2eae7cb017027682.js +1 -0
  110. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d4b2a0800a66b33.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-776b2e5b0b6ceba8.js} +1 -1
  111. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-03d9bca3bc5e6088.js +1 -0
  112. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-707ed8ca942ca802.js +1 -0
  113. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-259143ed3cf59e31.js → [...slug]-8429f17d4146e1ec.js} +1 -1
  114. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-193045d9836d8d80.js +1 -0
  115. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-d25d07db166cbb04.js +1 -0
  116. mage_ai/server/frontend_dist/_next/static/chunks/pages/platform/global-hooks/{[...slug]-5eeec927e4202b63.js → [...slug]-6834ae87bd668cb2.js} +1 -1
  117. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-fbe9ad995d46d837.js → frontend_dist/_next/static/chunks/pages/platform/global-hooks-b3f7309a23e592b2.js} +1 -1
  118. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/{profile-fc659962d4015cb3.js → profile-f8b7374385e1f1bf.js} +1 -1
  119. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-8de68502a9afa299.js +1 -0
  120. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-a4f88c334414402b.js → frontend_dist/_next/static/chunks/pages/settings/platform/settings-50fb6a34f3913f1f.js} +1 -1
  121. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-4deb9579ef99a3c6.js → [...slug]-2e5c098c21ea32b7.js} +1 -1
  122. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-e0cda2f2bfce8d61.js → permissions-54e4b15b9585bfc4.js} +1 -1
  123. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-040f83d75d0f6537.js +1 -0
  124. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-910257d16c604ebd.js → [...slug]-95088f43034e3c95.js} +1 -1
  125. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{roles-4f7a0756806cee34.js → roles-e9149e1fcf218f42.js} +1 -1
  126. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{sync-data-208d6f955204d704.js → sync-data-75b67ae4a00818ef.js} +1 -1
  127. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-c89dc67e5a1706a8.js → [...slug]-557dda05ca6c6124.js} +1 -1
  128. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-fa61dc6c1370e6a5.js +1 -0
  129. mage_ai/server/frontend_dist/_next/static/chunks/pages/{sign-in-054b33312d3193c3.js → sign-in-593c40985d63fcf7.js} +1 -1
  130. mage_ai/server/frontend_dist/_next/static/chunks/pages/templates/{[...slug]-b6ed6a5d818bfd20.js → [...slug]-252c4b6b818345d5.js} +1 -1
  131. mage_ai/server/frontend_dist/_next/static/chunks/pages/{templates-852357bc983af2ea.js → templates-ca528bc607753ab8.js} +1 -1
  132. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/terminal-1f9c56d671bbc67d.js → frontend_dist/_next/static/chunks/pages/terminal-287362c1defcc96b.js} +1 -1
  133. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-2f83af8c9f1378fe.js +1 -0
  134. mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-d9de73fb799efed8.js +1 -0
  135. mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/version-control-ae3469b992a341d6.js → frontend_dist/_next/static/chunks/pages/version-control-573f0225d7a703ed.js} +1 -1
  136. mage_ai/server/frontend_dist/block-layout.html +3 -3
  137. mage_ai/server/frontend_dist/compute.html +6 -6
  138. mage_ai/server/frontend_dist/files.html +6 -6
  139. mage_ai/server/frontend_dist/global-data-products/[...slug].html +6 -6
  140. mage_ai/server/frontend_dist/global-data-products.html +6 -6
  141. mage_ai/server/frontend_dist/global-hooks/[...slug].html +6 -6
  142. mage_ai/server/frontend_dist/global-hooks.html +6 -6
  143. mage_ai/server/frontend_dist/index.html +3 -3
  144. mage_ai/server/frontend_dist/manage/files.html +6 -6
  145. mage_ai/server/frontend_dist/manage/overview.html +6 -6
  146. mage_ai/server/frontend_dist/manage/pipeline-runs.html +6 -6
  147. mage_ai/server/frontend_dist/manage/settings.html +6 -6
  148. mage_ai/server/frontend_dist/manage/users/[user].html +6 -6
  149. mage_ai/server/frontend_dist/manage/users/new.html +6 -6
  150. mage_ai/server/frontend_dist/manage/users.html +6 -6
  151. mage_ai/server/frontend_dist/manage.html +6 -6
  152. mage_ai/server/frontend_dist/oauth.html +5 -5
  153. mage_ai/server/frontend_dist/overview.html +6 -6
  154. mage_ai/server/frontend_dist/pipeline-runs.html +6 -6
  155. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +6 -6
  156. mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +6 -6
  157. mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +6 -6
  158. mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
  159. mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +6 -6
  160. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +6 -6
  161. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
  162. mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +6 -6
  163. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +6 -6
  164. mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +6 -6
  165. mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +6 -6
  166. mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +6 -6
  167. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +6 -6
  168. mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +6 -6
  169. mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
  170. mage_ai/server/frontend_dist/pipelines.html +6 -6
  171. mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +6 -6
  172. mage_ai/server/frontend_dist/platform/global-hooks.html +6 -6
  173. mage_ai/server/frontend_dist/settings/account/profile.html +6 -6
  174. mage_ai/server/frontend_dist/settings/platform/preferences.html +6 -6
  175. mage_ai/server/frontend_dist/settings/platform/settings.html +6 -6
  176. mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +6 -6
  177. mage_ai/server/frontend_dist/settings/workspace/permissions.html +6 -6
  178. mage_ai/server/frontend_dist/settings/workspace/preferences.html +6 -6
  179. mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +6 -6
  180. mage_ai/server/frontend_dist/settings/workspace/roles.html +6 -6
  181. mage_ai/server/frontend_dist/settings/workspace/sync-data.html +6 -6
  182. mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +6 -6
  183. mage_ai/server/frontend_dist/settings/workspace/users.html +6 -6
  184. mage_ai/server/frontend_dist/settings.html +3 -3
  185. mage_ai/server/frontend_dist/sign-in.html +7 -7
  186. mage_ai/server/frontend_dist/templates/[...slug].html +6 -6
  187. mage_ai/server/frontend_dist/templates.html +6 -6
  188. mage_ai/server/frontend_dist/terminal.html +6 -6
  189. mage_ai/server/frontend_dist/test.html +3 -3
  190. mage_ai/server/frontend_dist/triggers.html +6 -6
  191. mage_ai/server/frontend_dist/v2/canvas.html +2 -2
  192. mage_ai/server/frontend_dist/v2.html +2 -2
  193. mage_ai/server/frontend_dist/version-control.html +6 -6
  194. mage_ai/server/frontend_dist_base_path_template/404.html +3 -3
  195. mage_ai/server/frontend_dist_base_path_template/_next/static/2QL-FT4lFR0a9bDZ7lNd9/_buildManifest.js +1 -0
  196. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1187-839336d276186105.js → 1187-4560c3895e1d7099.js} +1 -1
  197. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1598-0adca9dce3ba4c60.js → 1598-cbf3f5a6078fc3f5.js} +1 -1
  198. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-638a944d24d5abde.js +1 -0
  199. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-36f746b1824004f2.js +1 -0
  200. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3763-39a5174f6a3924db.js → 3763-aabe2703076636b0.js} +1 -1
  201. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-3e2acb5ed45b582b.js +1 -0
  202. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/449-5e2253c6aba42557.js +1 -0
  203. mage_ai/server/{frontend_dist/_next/static/chunks/5627-d5e559859dd0e1e0.js → frontend_dist_base_path_template/_next/static/chunks/5627-10e76bafa5a26f5f.js} +1 -1
  204. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5699-e49718dfc9eb2854.js → 5699-e99379e332bd0b41.js} +1 -1
  205. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7966-163da2621b8c987c.js → 7966-a5a7db345ce81263.js} +1 -1
  206. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-f205accb03b9ff43.js +2 -0
  207. mage_ai/server/{frontend_dist/_next/static/chunks/pages/compute-ed67fa8e81662e8b.js → frontend_dist_base_path_template/_next/static/chunks/pages/compute-9e2dea78024e3bb4.js} +1 -1
  208. mage_ai/server/{frontend_dist/_next/static/chunks/pages/files-e0ecd7ced09a63b2.js → frontend_dist_base_path_template/_next/static/chunks/pages/files-e08c7fe76f968f9c.js} +1 -1
  209. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/{[...slug]-c7a729477ecda50e.js → [...slug]-30c3807057a4e65b.js} +1 -1
  210. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-data-products-fd6ae6a358a60a0c.js → global-data-products-8dcb3b31af9e0e39.js} +1 -1
  211. mage_ai/server/{frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-8e50243797a7fe59.js → frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-85a64b64d27214b6.js} +1 -1
  212. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{global-hooks-d0c003446332dc0d.js → global-hooks-4ff959d51b8a9502.js} +1 -1
  213. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{files-a69ed8e9f814490c.js → files-d08a460641d0efaa.js} +1 -1
  214. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{overview-1aad7093c6d39257.js → overview-aae747f487e08d51.js} +1 -1
  215. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{pipeline-runs-528d30e0d13b0cc7.js → pipeline-runs-09a842d64a6ada62.js} +1 -1
  216. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{settings-fb9201d9cf63031d.js → settings-2e98e57d9376a458.js} +1 -1
  217. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/{[user]-000f5a980a07da39.js → [user]-7be6e41ad66089bb.js} +1 -1
  218. mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage/users/new-e4e613f6e817a733.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/new-4c088833063bfa07.js} +1 -1
  219. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-5db54821a3059c69.js +1 -0
  220. mage_ai/server/{frontend_dist/_next/static/chunks/pages/manage-34d718b8a4066c23.js → frontend_dist_base_path_template/_next/static/chunks/pages/manage-868fcd8cbeb265f0.js} +1 -1
  221. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{oauth-3bfd1b8d7f036726.js → oauth-6ceceb62191dfe8a.js} +1 -1
  222. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-f65416f6dbe30ad3.js +1 -0
  223. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{pipeline-runs-5f8c100e648efa8a.js → pipeline-runs-2d0136b51b57de93.js} +1 -1
  224. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-688c652f3296bb9c.js → [...slug]-1ad5238742e25b4c.js} +1 -1
  225. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-bd11e87d026bfbf9.js +1 -0
  226. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{dashboard-1236e36d39b1637d.js → dashboard-0f4f47f721b0723f.js} +1 -1
  227. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-5ae8efe9e0530212.js +1 -0
  228. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-fe91dfb0091f6bc6.js +1 -0
  229. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-0d68d4bf6290fefb.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runs-cf794b2d22a80f31.js} +1 -1
  230. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-9254358d58f07714.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-a964caef91bed9e1.js} +1 -1
  231. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{monitors-821001e690caebe2.js → monitors-80bebb4401eefe25.js} +1 -1
  232. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-2eae7cb017027682.js +1 -0
  233. mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs-2d4b2a0800a66b33.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs-776b2e5b0b6ceba8.js} +1 -1
  234. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-03d9bca3bc5e6088.js +1 -0
  235. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-707ed8ca942ca802.js +1 -0
  236. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/{[...slug]-259143ed3cf59e31.js → [...slug]-8429f17d4146e1ec.js} +1 -1
  237. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-193045d9836d8d80.js +1 -0
  238. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-d25d07db166cbb04.js +1 -0
  239. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks/{[...slug]-5eeec927e4202b63.js → [...slug]-6834ae87bd668cb2.js} +1 -1
  240. mage_ai/server/{frontend_dist/_next/static/chunks/pages/platform/global-hooks-fbe9ad995d46d837.js → frontend_dist_base_path_template/_next/static/chunks/pages/platform/global-hooks-b3f7309a23e592b2.js} +1 -1
  241. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/{profile-fc659962d4015cb3.js → profile-f8b7374385e1f1bf.js} +1 -1
  242. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-8de68502a9afa299.js +1 -0
  243. mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/settings-a4f88c334414402b.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-50fb6a34f3913f1f.js} +1 -1
  244. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-4deb9579ef99a3c6.js → [...slug]-2e5c098c21ea32b7.js} +1 -1
  245. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-e0cda2f2bfce8d61.js → permissions-54e4b15b9585bfc4.js} +1 -1
  246. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-040f83d75d0f6537.js +1 -0
  247. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-910257d16c604ebd.js → [...slug]-95088f43034e3c95.js} +1 -1
  248. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{roles-4f7a0756806cee34.js → roles-e9149e1fcf218f42.js} +1 -1
  249. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{sync-data-208d6f955204d704.js → sync-data-75b67ae4a00818ef.js} +1 -1
  250. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-c89dc67e5a1706a8.js → [...slug]-557dda05ca6c6124.js} +1 -1
  251. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-fa61dc6c1370e6a5.js +1 -0
  252. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{sign-in-054b33312d3193c3.js → sign-in-593c40985d63fcf7.js} +1 -1
  253. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/templates/{[...slug]-b6ed6a5d818bfd20.js → [...slug]-252c4b6b818345d5.js} +1 -1
  254. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{templates-852357bc983af2ea.js → templates-ca528bc607753ab8.js} +1 -1
  255. mage_ai/server/{frontend_dist/_next/static/chunks/pages/terminal-1f9c56d671bbc67d.js → frontend_dist_base_path_template/_next/static/chunks/pages/terminal-287362c1defcc96b.js} +1 -1
  256. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-2f83af8c9f1378fe.js +1 -0
  257. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-d9de73fb799efed8.js +1 -0
  258. mage_ai/server/{frontend_dist/_next/static/chunks/pages/version-control-ae3469b992a341d6.js → frontend_dist_base_path_template/_next/static/chunks/pages/version-control-573f0225d7a703ed.js} +1 -1
  259. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-12ad70eb5c31aa92.js → webpack-5f4be622608d9267.js} +1 -1
  260. mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
  261. mage_ai/server/frontend_dist_base_path_template/compute.html +6 -6
  262. mage_ai/server/frontend_dist_base_path_template/files.html +6 -6
  263. mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +6 -6
  264. mage_ai/server/frontend_dist_base_path_template/global-data-products.html +6 -6
  265. mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +6 -6
  266. mage_ai/server/frontend_dist_base_path_template/global-hooks.html +6 -6
  267. mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
  268. mage_ai/server/frontend_dist_base_path_template/manage/files.html +6 -6
  269. mage_ai/server/frontend_dist_base_path_template/manage/overview.html +6 -6
  270. mage_ai/server/frontend_dist_base_path_template/manage/pipeline-runs.html +6 -6
  271. mage_ai/server/frontend_dist_base_path_template/manage/settings.html +6 -6
  272. mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +6 -6
  273. mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +6 -6
  274. mage_ai/server/frontend_dist_base_path_template/manage/users.html +6 -6
  275. mage_ai/server/frontend_dist_base_path_template/manage.html +6 -6
  276. mage_ai/server/frontend_dist_base_path_template/oauth.html +5 -5
  277. mage_ai/server/frontend_dist_base_path_template/overview.html +6 -6
  278. mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +6 -6
  279. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +6 -6
  280. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +6 -6
  281. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +6 -6
  282. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
  283. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +6 -6
  284. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +6 -6
  285. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
  286. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +6 -6
  287. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +6 -6
  288. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +6 -6
  289. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +6 -6
  290. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +6 -6
  291. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +6 -6
  292. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +6 -6
  293. mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
  294. mage_ai/server/frontend_dist_base_path_template/pipelines.html +6 -6
  295. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +6 -6
  296. mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +6 -6
  297. mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +6 -6
  298. mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +6 -6
  299. mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +6 -6
  300. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +6 -6
  301. mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +6 -6
  302. mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +6 -6
  303. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +6 -6
  304. mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +6 -6
  305. mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +6 -6
  306. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +6 -6
  307. mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +6 -6
  308. mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
  309. mage_ai/server/frontend_dist_base_path_template/sign-in.html +7 -7
  310. mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +6 -6
  311. mage_ai/server/frontend_dist_base_path_template/templates.html +6 -6
  312. mage_ai/server/frontend_dist_base_path_template/terminal.html +6 -6
  313. mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
  314. mage_ai/server/frontend_dist_base_path_template/triggers.html +6 -6
  315. mage_ai/server/frontend_dist_base_path_template/v2/canvas.html +2 -2
  316. mage_ai/server/frontend_dist_base_path_template/v2.html +2 -2
  317. mage_ai/server/frontend_dist_base_path_template/version-control.html +6 -6
  318. mage_ai/server/scheduler_manager.py +2 -0
  319. mage_ai/server/server.py +13 -0
  320. mage_ai/server/terminal_server.py +3 -0
  321. mage_ai/server/utils/output_display.py +5 -3
  322. mage_ai/services/aws/events/events.py +2 -2
  323. mage_ai/services/gcp/cloud_run/cloud_run.py +1 -1
  324. mage_ai/services/teams/config.py +13 -2
  325. mage_ai/services/teams/teams.py +13 -11
  326. mage_ai/settings/server.py +12 -1
  327. mage_ai/shared/constants.py +3 -1
  328. mage_ai/shared/croniter.py +1398 -0
  329. mage_ai/shared/enum.py +2 -5
  330. mage_ai/shared/environments.py +27 -3
  331. mage_ai/streaming/sinks/elasticsearch.py +15 -5
  332. mage_ai/streaming/sinks/kafka.py +21 -3
  333. mage_ai/streaming/sources/kafka.py +64 -7
  334. mage_ai/streaming/sources/kafka_oauth.py +182 -0
  335. mage_ai/tests/api/endpoints/test_blocks.py +1 -101
  336. mage_ai/tests/api/endpoints/test_configuration_options.py +1 -48
  337. mage_ai/tests/api/endpoints/test_configuration_options_project_platform.py +68 -0
  338. mage_ai/tests/api/endpoints/test_custom_designs.py +1 -106
  339. mage_ai/tests/api/endpoints/test_custom_designs_project_platform.py +132 -0
  340. mage_ai/tests/api/endpoints/test_dbt_blocks.py +111 -0
  341. mage_ai/tests/api/endpoints/test_file_contents.py +0 -48
  342. mage_ai/tests/api/endpoints/test_file_contents_with_project_platform.py +66 -0
  343. mage_ai/tests/api/endpoints/test_pipelines.py +0 -134
  344. mage_ai/tests/api/endpoints/test_pipelines_with_project_platform.py +143 -0
  345. mage_ai/tests/data_preparation/executors/test_block_executor.py +3 -3
  346. mage_ai/tests/data_preparation/logging/test_logger_manager.py +24 -5
  347. mage_ai/tests/data_preparation/models/block/dynamic/test_counter.py +1 -3
  348. mage_ai/tests/data_preparation/models/block/hook/test_hook_block.py +3 -3
  349. mage_ai/tests/data_preparation/models/test_block.py +7 -0
  350. mage_ai/tests/data_preparation/models/test_pipeline.py +55 -0
  351. mage_ai/tests/data_preparation/models/test_variable.py +2 -0
  352. mage_ai/tests/data_preparation/test_repo_manager.py +0 -63
  353. mage_ai/tests/data_preparation/test_repo_manager_project_platform.py +67 -0
  354. mage_ai/tests/data_preparation/test_variable_manager.py +0 -51
  355. mage_ai/tests/data_preparation/test_variable_manager_project_platform.py +41 -0
  356. mage_ai/tests/io/create_table/test_postgresql.py +28 -0
  357. mage_ai/tests/orchestration/db/models/test_schedules.py +1 -1
  358. mage_ai/tests/orchestration/notification/test_config.py +3 -3
  359. mage_ai/tests/orchestration/notification/test_sender.py +5 -1
  360. mage_ai/tests/orchestration/utils/__init__.py +0 -0
  361. mage_ai/tests/orchestration/utils/test_resources.py +235 -0
  362. mage_ai/tests/shared/test_croniter.py +2541 -0
  363. mage_ai/tests/streaming/sinks/test_kafka.py +130 -0
  364. mage_ai/tests/streaming/sources/test_kafka.py +125 -3
  365. mage_ai/tests/streaming/sources/test_kafka_oauth.py +208 -0
  366. mage_ai/tests/streaming/sources/test_kafka_raw_value.py +105 -0
  367. mage_ai/usage_statistics/logger.py +99 -15
  368. mage_ai-0.9.79.dist-info/METADATA +358 -0
  369. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/RECORD +377 -359
  370. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/WHEEL +1 -1
  371. mage_ai/server/frontend_dist/_next/static/chunks/1557-1ad0c64c2d08e569.js +0 -1
  372. mage_ai/server/frontend_dist/_next/static/chunks/2717-d65056b6b5e124eb.js +0 -1
  373. mage_ai/server/frontend_dist/_next/static/chunks/3548-b2c5edfb710886a6.js +0 -1
  374. mage_ai/server/frontend_dist/_next/static/chunks/3782-4b3091e550f809a2.js +0 -1
  375. mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-5bdff745074fb350.js +0 -2
  376. mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users-a5e9d77ed5b50205.js +0 -1
  377. mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-69af3253ad0d0d89.js +0 -1
  378. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-fe112809feb25b05.js +0 -1
  379. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-e9ca358209cdf93d.js +0 -1
  380. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/logs-a29f1615d2e7d330.js +0 -1
  381. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-6d382ae5bad9745c.js +0 -1
  382. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-cd49372ae1702963.js +0 -1
  383. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-135be8974f7f5f2b.js +0 -1
  384. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-3af13e89adff4d6c.js +0 -1
  385. mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-b578b075a8d857e3.js +0 -1
  386. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-058d283ee178c038.js +0 -1
  387. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-7b02bb70462144cb.js +0 -1
  388. mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users-5212c01a9dc558da.js +0 -1
  389. mage_ai/server/frontend_dist/_next/static/chunks/pages/test-86b12cc12d4a625f.js +0 -1
  390. mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-2481c40b18d5b6d4.js +0 -1
  391. mage_ai/server/frontend_dist/_next/static/pLWT6Sqd09xYpufCVIqnz/_buildManifest.js +0 -1
  392. mage_ai/server/frontend_dist_base_path_template/_next/static/JQewSAObpbhO0wrdAM6Ng/_buildManifest.js +0 -1
  393. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-1ad0c64c2d08e569.js +0 -1
  394. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-d65056b6b5e124eb.js +0 -1
  395. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-b2c5edfb710886a6.js +0 -1
  396. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-4b3091e550f809a2.js +0 -1
  397. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-90de19bc03f1484b.js +0 -2
  398. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users-a5e9d77ed5b50205.js +0 -1
  399. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-69af3253ad0d0d89.js +0 -1
  400. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-fe112809feb25b05.js +0 -1
  401. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-e9ca358209cdf93d.js +0 -1
  402. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/logs-a29f1615d2e7d330.js +0 -1
  403. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-6d382ae5bad9745c.js +0 -1
  404. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-cd49372ae1702963.js +0 -1
  405. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-135be8974f7f5f2b.js +0 -1
  406. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-3af13e89adff4d6c.js +0 -1
  407. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-b578b075a8d857e3.js +0 -1
  408. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-058d283ee178c038.js +0 -1
  409. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-7b02bb70462144cb.js +0 -1
  410. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users-5212c01a9dc558da.js +0 -1
  411. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/test-86b12cc12d4a625f.js +0 -1
  412. mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-2481c40b18d5b6d4.js +0 -1
  413. mage_ai-0.9.74.dist-info/METADATA +0 -544
  414. /mage_ai/server/frontend_dist/_next/static/{pLWT6Sqd09xYpufCVIqnz → TUo4RceCdMufBTBTq8CAq}/_ssgManifest.js +0 -0
  415. /mage_ai/server/frontend_dist/_next/static/chunks/pages/{_app-5bdff745074fb350.js.LICENSE.txt → _app-b697b35dfc4e6e26.js.LICENSE.txt} +0 -0
  416. /mage_ai/server/frontend_dist_base_path_template/_next/static/{JQewSAObpbhO0wrdAM6Ng → 2QL-FT4lFR0a9bDZ7lNd9}/_ssgManifest.js +0 -0
  417. /mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{_app-90de19bc03f1484b.js.LICENSE.txt → _app-f205accb03b9ff43.js.LICENSE.txt} +0 -0
  418. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/entry_points.txt +0 -0
  419. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info/licenses}/LICENSE +0 -0
  420. {mage_ai-0.9.74.dist-info → mage_ai-0.9.79.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,130 @@
1
+ from unittest.mock import Mock, patch
2
+
3
+ from mage_ai.streaming.sinks.kafka import KafkaSink
4
+ from mage_ai.tests.base_test import TestCase
5
+
6
+
7
+ class KafkaSinkTests(TestCase):
8
+ def test_init(self):
9
+ with patch.object(KafkaSink, 'init_client') as mock_init_client:
10
+ KafkaSink(dict(
11
+ connector_type='kafka',
12
+ bootstrap_server='test_server',
13
+ topic='test_topic',
14
+ ))
15
+ mock_init_client.assert_called_once()
16
+
17
+ def test_init_with_oauth_sasl_config(self):
18
+ with patch.object(KafkaSink, 'init_client') as mock_init_client:
19
+ sink = KafkaSink(dict(
20
+ connector_type='kafka',
21
+ bootstrap_server='test_server',
22
+ topic='test_topic',
23
+ security_protocol='SASL_SSL',
24
+ sasl_config=dict(
25
+ mechanism='OAUTHBEARER',
26
+ oauth_token_url='https://auth.example.com/token',
27
+ oauth_client_id='test_client',
28
+ oauth_client_secret='test_secret',
29
+ oauth_scope='kafka',
30
+ ),
31
+ ))
32
+ mock_init_client.assert_called_once()
33
+ self.assertEqual(sink.config.security_protocol, 'SASL_SSL')
34
+ self.assertEqual(sink.config.sasl_config.mechanism, 'OAUTHBEARER')
35
+ self.assertEqual(
36
+ sink.config.sasl_config.oauth_token_url, 'https://auth.example.com/token')
37
+ self.assertEqual(sink.config.sasl_config.oauth_client_id, 'test_client')
38
+ self.assertEqual(sink.config.sasl_config.oauth_client_secret, 'test_secret')
39
+ self.assertEqual(sink.config.sasl_config.oauth_scope, 'kafka')
40
+ self.assertIsNone(sink.config.ssl_config)
41
+
42
+ def test_init_client_with_oauthbearer(self):
43
+ kafka_config = dict(
44
+ connector_type='kafka',
45
+ bootstrap_server='test_server',
46
+ topic='test_topic',
47
+ security_protocol='SASL_SSL',
48
+ sasl_config=dict(
49
+ mechanism='OAUTHBEARER',
50
+ oauth_token_url='https://auth.example.com/token',
51
+ oauth_client_id='test_client',
52
+ oauth_client_secret='test_secret',
53
+ ),
54
+ )
55
+
56
+ with patch('mage_ai.streaming.sinks.kafka.KafkaProducer') as mock_producer:
57
+ with patch('mage_ai.streaming.sources.kafka_oauth.requests.post') as mock_post:
58
+ # Mock the OAuth token response
59
+ mock_response = Mock()
60
+ mock_response.json.return_value = {
61
+ 'access_token': 'test_token',
62
+ 'expires_in': 3600,
63
+ }
64
+ mock_response.raise_for_status = Mock()
65
+ mock_post.return_value = mock_response
66
+
67
+ KafkaSink(kafka_config)
68
+
69
+ # Verify KafkaProducer was called with correct parameters
70
+ self.assertEqual(mock_producer.call_count, 1)
71
+ args, kwargs = mock_producer.call_args
72
+ self.assertEqual(kwargs['bootstrap_servers'], 'test_server')
73
+ self.assertEqual(kwargs['security_protocol'], 'SASL_SSL')
74
+ self.assertEqual(kwargs['sasl_mechanism'], 'OAUTHBEARER')
75
+ self.assertIn('sasl_oauth_token_provider', kwargs)
76
+ self.assertIsNotNone(kwargs['sasl_oauth_token_provider'])
77
+
78
+ def test_init_client_with_oauthbearer_missing_token_url(self):
79
+ kafka_config = dict(
80
+ connector_type='kafka',
81
+ bootstrap_server='test_server',
82
+ topic='test_topic',
83
+ security_protocol='SASL_SSL',
84
+ sasl_config=dict(
85
+ mechanism='OAUTHBEARER',
86
+ oauth_client_id='test_client',
87
+ oauth_client_secret='test_secret',
88
+ ),
89
+ )
90
+
91
+ with self.assertRaises(Exception) as context:
92
+ KafkaSink(kafka_config)
93
+
94
+ self.assertIn('oauth_token_url is required', str(context.exception))
95
+
96
+ def test_init_client_with_oauthbearer_missing_client_id(self):
97
+ kafka_config = dict(
98
+ connector_type='kafka',
99
+ bootstrap_server='test_server',
100
+ topic='test_topic',
101
+ security_protocol='SASL_SSL',
102
+ sasl_config=dict(
103
+ mechanism='OAUTHBEARER',
104
+ oauth_token_url='https://auth.example.com/token',
105
+ oauth_client_secret='test_secret',
106
+ ),
107
+ )
108
+
109
+ with self.assertRaises(Exception) as context:
110
+ KafkaSink(kafka_config)
111
+
112
+ self.assertIn('oauth_client_id is required', str(context.exception))
113
+
114
+ def test_init_client_with_oauthbearer_missing_client_secret(self):
115
+ kafka_config = dict(
116
+ connector_type='kafka',
117
+ bootstrap_server='test_server',
118
+ topic='test_topic',
119
+ security_protocol='SASL_SSL',
120
+ sasl_config=dict(
121
+ mechanism='OAUTHBEARER',
122
+ oauth_token_url='https://auth.example.com/token',
123
+ oauth_client_id='test_client',
124
+ ),
125
+ )
126
+
127
+ with self.assertRaises(Exception) as context:
128
+ KafkaSink(kafka_config)
129
+
130
+ self.assertIn('oauth_client_secret is required', str(context.exception))
@@ -1,4 +1,4 @@
1
- from unittest.mock import patch
1
+ from unittest.mock import Mock, patch
2
2
 
3
3
  from mage_ai.streaming.sources.kafka import KafkaSource
4
4
  from mage_ai.tests.base_test import TestCase
@@ -33,7 +33,7 @@ class KafkaTests(TestCase):
33
33
  api_version='0.10.2',
34
34
  auto_offset_reset='latest',
35
35
  max_partition_fetch_bytes=1048576,
36
- enable_auto_commit=True,
36
+ enable_auto_commit=False,
37
37
  )
38
38
 
39
39
  def test_init_client_with_topics(self):
@@ -56,7 +56,7 @@ class KafkaTests(TestCase):
56
56
  api_version='0.10.2',
57
57
  auto_offset_reset='latest',
58
58
  max_partition_fetch_bytes=1048576,
59
- enable_auto_commit=True,
59
+ enable_auto_commit=False,
60
60
  )
61
61
 
62
62
  def test_init_client_with_missing_topic_or_topics(self):
@@ -93,6 +93,128 @@ class KafkaTests(TestCase):
93
93
  self.assertEqual(source.config.sasl_config.password, 'test_password')
94
94
  self.assertIsNone(source.config.ssl_config)
95
95
 
96
+ def test_init_with_oauth_sasl_config(self):
97
+ with patch.object(KafkaSource, 'init_client') as mock_init_client:
98
+ source = KafkaSource(dict(
99
+ connector_type='kafka',
100
+ bootstrap_server='test_server',
101
+ consumer_group='test_group',
102
+ topic='test_topic',
103
+ security_protocol='SASL_SSL',
104
+ sasl_config=dict(
105
+ mechanism='OAUTHBEARER',
106
+ oauth_token_url='https://auth.example.com/token',
107
+ oauth_client_id='test_client',
108
+ oauth_client_secret='test_secret',
109
+ oauth_scope='kafka',
110
+ ),
111
+ ))
112
+ mock_init_client.assert_called_once()
113
+ self.assertEqual(source.config.security_protocol, 'SASL_SSL')
114
+ self.assertEqual(source.config.sasl_config.mechanism, 'OAUTHBEARER')
115
+ self.assertEqual(
116
+ source.config.sasl_config.oauth_token_url, 'https://auth.example.com/token')
117
+ self.assertEqual(source.config.sasl_config.oauth_client_id, 'test_client')
118
+ self.assertEqual(source.config.sasl_config.oauth_client_secret, 'test_secret')
119
+ self.assertEqual(source.config.sasl_config.oauth_scope, 'kafka')
120
+ self.assertIsNone(source.config.ssl_config)
121
+
122
+ def test_init_client_with_oauthbearer(self):
123
+ kafka_config = dict(
124
+ connector_type='kafka',
125
+ bootstrap_server='test_server',
126
+ consumer_group='test_group',
127
+ topic='test_topic',
128
+ security_protocol='SASL_SSL',
129
+ sasl_config=dict(
130
+ mechanism='OAUTHBEARER',
131
+ oauth_token_url='https://auth.example.com/token',
132
+ oauth_client_id='test_client',
133
+ oauth_client_secret='test_secret',
134
+ ),
135
+ )
136
+
137
+ with patch('mage_ai.streaming.sources.kafka.KafkaConsumer') as mock_consumer:
138
+ with patch('mage_ai.streaming.sources.kafka_oauth.requests.post') as mock_post:
139
+ # Mock the OAuth token response
140
+ mock_response = Mock()
141
+ mock_response.json.return_value = {
142
+ 'access_token': 'test_token',
143
+ 'expires_in': 3600,
144
+ }
145
+ mock_response.raise_for_status = Mock()
146
+ mock_post.return_value = mock_response
147
+
148
+ KafkaSource(kafka_config)
149
+
150
+ # Verify KafkaConsumer was called with correct parameters
151
+ self.assertEqual(mock_consumer.call_count, 1)
152
+ args, kwargs = mock_consumer.call_args
153
+ self.assertEqual(args, ('test_topic',))
154
+ self.assertEqual(kwargs['group_id'], 'test_group')
155
+ self.assertEqual(kwargs['bootstrap_servers'], 'test_server')
156
+ self.assertEqual(kwargs['security_protocol'], 'SASL_SSL')
157
+ self.assertEqual(kwargs['sasl_mechanism'], 'OAUTHBEARER')
158
+ self.assertIn('sasl_oauth_token_provider', kwargs)
159
+ self.assertIsNotNone(kwargs['sasl_oauth_token_provider'])
160
+
161
+ def test_init_client_with_oauthbearer_missing_token_url(self):
162
+ kafka_config = dict(
163
+ connector_type='kafka',
164
+ bootstrap_server='test_server',
165
+ consumer_group='test_group',
166
+ topic='test_topic',
167
+ security_protocol='SASL_SSL',
168
+ sasl_config=dict(
169
+ mechanism='OAUTHBEARER',
170
+ oauth_client_id='test_client',
171
+ oauth_client_secret='test_secret',
172
+ ),
173
+ )
174
+
175
+ with self.assertRaises(Exception) as context:
176
+ KafkaSource(kafka_config)
177
+
178
+ self.assertIn('oauth_token_url is required', str(context.exception))
179
+
180
+ def test_init_client_with_oauthbearer_missing_client_id(self):
181
+ kafka_config = dict(
182
+ connector_type='kafka',
183
+ bootstrap_server='test_server',
184
+ consumer_group='test_group',
185
+ topic='test_topic',
186
+ security_protocol='SASL_SSL',
187
+ sasl_config=dict(
188
+ mechanism='OAUTHBEARER',
189
+ oauth_token_url='https://auth.example.com/token',
190
+ oauth_client_secret='test_secret',
191
+ ),
192
+ )
193
+
194
+ with self.assertRaises(Exception) as context:
195
+ KafkaSource(kafka_config)
196
+
197
+ self.assertIn('oauth_client_id is required', str(context.exception))
198
+
199
+ def test_init_client_with_oauthbearer_missing_client_secret(self):
200
+ kafka_config = dict(
201
+ connector_type='kafka',
202
+ bootstrap_server='test_server',
203
+ consumer_group='test_group',
204
+ topic='test_topic',
205
+ security_protocol='SASL_SSL',
206
+ sasl_config=dict(
207
+ mechanism='OAUTHBEARER',
208
+ oauth_token_url='https://auth.example.com/token',
209
+ oauth_client_id='test_client',
210
+ ),
211
+ )
212
+
213
+ with self.assertRaises(Exception) as context:
214
+ KafkaSource(kafka_config)
215
+
216
+ self.assertIn('oauth_client_secret is required', str(context.exception))
217
+
96
218
  def test_init_with_serde_config(self):
97
219
  with patch.object(KafkaSource, 'init_client') as mock_init_client:
98
220
  source = KafkaSource(dict(
@@ -0,0 +1,208 @@
1
+ from unittest.mock import Mock, patch
2
+
3
+ import requests
4
+
5
+ from mage_ai.streaming.sources.kafka_oauth import ClientCredentialsTokenProvider
6
+ from mage_ai.tests.base_test import TestCase
7
+
8
+
9
+ class ClientCredentialsTokenProviderTests(TestCase):
10
+ def test_init(self):
11
+ """Test token provider initialization"""
12
+ provider = ClientCredentialsTokenProvider(
13
+ token_url='https://auth.example.com/token',
14
+ client_id='test_client',
15
+ client_secret='test_secret',
16
+ scope='kafka',
17
+ )
18
+
19
+ self.assertEqual(provider.token_url, 'https://auth.example.com/token')
20
+ self.assertEqual(provider.client_id, 'test_client')
21
+ self.assertEqual(provider.client_secret, 'test_secret')
22
+ self.assertEqual(provider.scope, 'kafka')
23
+ self.assertIsNone(provider._access_token)
24
+ self.assertIsNone(provider._token_expiry_time)
25
+
26
+ @patch('mage_ai.streaming.sources.kafka_oauth.requests.post')
27
+ def test_token_fetch(self, mock_post):
28
+ """Test successful token fetch"""
29
+ mock_response = Mock()
30
+ mock_response.json.return_value = {
31
+ 'access_token': 'test_token_123',
32
+ 'expires_in': 3600,
33
+ }
34
+ mock_response.raise_for_status = Mock()
35
+ mock_post.return_value = mock_response
36
+
37
+ provider = ClientCredentialsTokenProvider(
38
+ token_url='https://auth.example.com/token',
39
+ client_id='test_client',
40
+ client_secret='test_secret',
41
+ )
42
+
43
+ token = provider.token()
44
+
45
+ self.assertEqual(token, 'test_token_123')
46
+ mock_post.assert_called_once_with(
47
+ 'https://auth.example.com/token',
48
+ data={
49
+ 'grant_type': 'client_credentials',
50
+ 'client_id': 'test_client',
51
+ 'client_secret': 'test_secret',
52
+ },
53
+ headers={'Content-Type': 'application/x-www-form-urlencoded'},
54
+ timeout=10,
55
+ )
56
+
57
+ @patch('mage_ai.streaming.sources.kafka_oauth.requests.post')
58
+ def test_token_fetch_with_scope(self, mock_post):
59
+ """Test token fetch with scope parameter"""
60
+ mock_response = Mock()
61
+ mock_response.json.return_value = {
62
+ 'access_token': 'test_token_123',
63
+ 'expires_in': 3600,
64
+ }
65
+ mock_response.raise_for_status = Mock()
66
+ mock_post.return_value = mock_response
67
+
68
+ provider = ClientCredentialsTokenProvider(
69
+ token_url='https://auth.example.com/token',
70
+ client_id='test_client',
71
+ client_secret='test_secret',
72
+ scope='kafka',
73
+ )
74
+
75
+ token = provider.token()
76
+
77
+ self.assertEqual(token, 'test_token_123')
78
+ mock_post.assert_called_once_with(
79
+ 'https://auth.example.com/token',
80
+ data={
81
+ 'grant_type': 'client_credentials',
82
+ 'client_id': 'test_client',
83
+ 'client_secret': 'test_secret',
84
+ 'scope': 'kafka',
85
+ },
86
+ headers={'Content-Type': 'application/x-www-form-urlencoded'},
87
+ timeout=10,
88
+ )
89
+
90
+ @patch('mage_ai.streaming.sources.kafka_oauth.requests.post')
91
+ def test_token_reuse(self, mock_post):
92
+ """Test that token is reused when not expired"""
93
+ mock_response = Mock()
94
+ mock_response.json.return_value = {
95
+ 'access_token': 'test_token_123',
96
+ 'expires_in': 3600,
97
+ }
98
+ mock_response.raise_for_status = Mock()
99
+ mock_post.return_value = mock_response
100
+
101
+ provider = ClientCredentialsTokenProvider(
102
+ token_url='https://auth.example.com/token',
103
+ client_id='test_client',
104
+ client_secret='test_secret',
105
+ )
106
+
107
+ # First call should fetch token
108
+ token1 = provider.token()
109
+ self.assertEqual(token1, 'test_token_123')
110
+ self.assertEqual(mock_post.call_count, 1)
111
+
112
+ # Second call should reuse token
113
+ token2 = provider.token()
114
+ self.assertEqual(token2, 'test_token_123')
115
+ self.assertEqual(mock_post.call_count, 1)
116
+
117
+ @patch('mage_ai.streaming.sources.kafka_oauth.requests.post')
118
+ @patch('mage_ai.streaming.sources.kafka_oauth.time.time')
119
+ def test_token_refresh_on_expiry(self, mock_time, mock_post):
120
+ """Test that token is refreshed when expired"""
121
+ mock_response = Mock()
122
+ mock_response.json.return_value = {
123
+ 'access_token': 'test_token_123',
124
+ 'expires_in': 120,
125
+ }
126
+ mock_response.raise_for_status = Mock()
127
+ mock_post.return_value = mock_response
128
+
129
+ # Start time
130
+ mock_time.return_value = 1000.0
131
+
132
+ provider = ClientCredentialsTokenProvider(
133
+ token_url='https://auth.example.com/token',
134
+ client_id='test_client',
135
+ client_secret='test_secret',
136
+ token_expiry_buffer=60,
137
+ )
138
+
139
+ # First call should fetch token
140
+ token1 = provider.token()
141
+ self.assertEqual(token1, 'test_token_123')
142
+ self.assertEqual(mock_post.call_count, 1)
143
+
144
+ # Move time forward but not past expiry buffer
145
+ mock_time.return_value = 1030.0
146
+ token2 = provider.token()
147
+ self.assertEqual(token2, 'test_token_123')
148
+ self.assertEqual(mock_post.call_count, 1)
149
+
150
+ # Move time forward past expiry buffer
151
+ # Token expires at 1000 + 120 = 1120, buffer is 60, so refresh at 1060
152
+ mock_response.json.return_value = {
153
+ 'access_token': 'test_token_456',
154
+ 'expires_in': 120,
155
+ }
156
+ mock_time.return_value = 1070.0
157
+ token3 = provider.token()
158
+ self.assertEqual(token3, 'test_token_456')
159
+ self.assertEqual(mock_post.call_count, 2)
160
+
161
+ @patch('mage_ai.streaming.sources.kafka_oauth.requests.post')
162
+ def test_token_fetch_failure(self, mock_post):
163
+ """Test handling of token fetch failure"""
164
+ mock_post.side_effect = requests.exceptions.RequestException('Network error')
165
+
166
+ provider = ClientCredentialsTokenProvider(
167
+ token_url='https://auth.example.com/token',
168
+ client_id='test_client',
169
+ client_secret='test_secret',
170
+ )
171
+
172
+ with self.assertRaises(RuntimeError) as context:
173
+ provider.token()
174
+
175
+ self.assertIn('Failed to fetch OAuth token', str(context.exception))
176
+
177
+ @patch('mage_ai.streaming.sources.kafka_oauth.requests.post')
178
+ def test_token_invalid_response(self, mock_post):
179
+ """Test handling of invalid token response"""
180
+ mock_response = Mock()
181
+ mock_response.json.return_value = {
182
+ 'invalid': 'response',
183
+ }
184
+ mock_response.raise_for_status = Mock()
185
+ mock_post.return_value = mock_response
186
+
187
+ provider = ClientCredentialsTokenProvider(
188
+ token_url='https://auth.example.com/token',
189
+ client_id='test_client',
190
+ client_secret='test_secret',
191
+ )
192
+
193
+ with self.assertRaises(RuntimeError) as context:
194
+ provider.token()
195
+
196
+ self.assertIn('Invalid token response format', str(context.exception))
197
+ self.assertIn('missing', str(context.exception))
198
+
199
+ def test_extensions(self):
200
+ """Test that extensions returns empty dict"""
201
+ provider = ClientCredentialsTokenProvider(
202
+ token_url='https://auth.example.com/token',
203
+ client_id='test_client',
204
+ client_secret='test_secret',
205
+ )
206
+
207
+ extensions = provider.extensions()
208
+ self.assertEqual(extensions, {})
@@ -0,0 +1,105 @@
1
+ from unittest import TestCase
2
+ from unittest.mock import MagicMock, patch
3
+ import json
4
+
5
+ from mage_ai.streaming.sources.kafka import KafkaSource
6
+ from mage_ai.streaming.sources.shared import SerializationMethod
7
+
8
+
9
+ class KafkaRawValueTests(TestCase):
10
+ @patch('mage_ai.streaming.sources.kafka.KafkaConsumer')
11
+ def test_kafka_raw_value_key_handling(self, mock_kafka):
12
+ # Create a mock message with non-UTF8 key
13
+ mock_message = MagicMock()
14
+ mock_message.key = b'\xff\x83\x00' # Invalid UTF-8 bytes
15
+ mock_message.value = b'test_value'
16
+ mock_message.partition = 1
17
+ mock_message.offset = 100
18
+ mock_message.timestamp = 1234567890
19
+ mock_message.topic = 'test_topic'
20
+
21
+ # Configure source with RAW_VALUE
22
+ config = {
23
+ 'bootstrap_server': 'dummy',
24
+ 'consumer_group': 'test',
25
+ 'topic': 'test_topic',
26
+ 'include_metadata': True,
27
+ 'serde_config': {
28
+ 'serialization_method': SerializationMethod.RAW_VALUE
29
+ }
30
+ }
31
+
32
+ source = KafkaSource(config)
33
+
34
+ # Test message conversion
35
+ result = source._convert_message(mock_message)
36
+
37
+ self.assertIsInstance(result, dict)
38
+ self.assertIn('metadata', result)
39
+ self.assertIn('key', result['metadata'])
40
+ # With RAW_VALUE, key should remain as bytes
41
+ self.assertEqual(result['metadata']['key'], b'\xff\x83\x00')
42
+ self.assertEqual(result['data'], b'test_value')
43
+
44
+ @patch('mage_ai.streaming.sources.kafka.KafkaConsumer')
45
+ def test_kafka_utf8_key_handling(self, mock_kafka):
46
+ # Create a mock message with UTF-8 key
47
+ mock_message = MagicMock()
48
+ mock_message.key = 'test_key'.encode('utf-8')
49
+ mock_message.value = json.dumps({'value': 'test_value'}).encode('utf-8')
50
+ mock_message.partition = 1
51
+ mock_message.offset = 100
52
+ mock_message.timestamp = 1234567890
53
+ mock_message.topic = 'test_topic'
54
+
55
+ # Configure source without RAW_VALUE
56
+ config = {
57
+ 'bootstrap_server': 'dummy',
58
+ 'consumer_group': 'test',
59
+ 'topic': 'test_topic',
60
+ 'include_metadata': True
61
+ }
62
+
63
+ source = KafkaSource(config)
64
+
65
+ # Test message conversion
66
+ result = source._convert_message(mock_message)
67
+
68
+ self.assertIsInstance(result, dict)
69
+ self.assertIn('metadata', result)
70
+ self.assertIn('key', result['metadata'])
71
+ # Without RAW_VALUE, key should be decoded to string
72
+ self.assertEqual(result['metadata']['key'], 'test_key')
73
+ self.assertIsInstance(result['data'], dict)
74
+ self.assertEqual(result['data']['value'], 'test_value')
75
+
76
+ @patch('mage_ai.streaming.sources.kafka.KafkaConsumer')
77
+ def test_kafka_non_utf8_key_without_raw_value(self, mock_kafka):
78
+ # Create a mock message with non-UTF8 key but without RAW_VALUE
79
+ mock_message = MagicMock()
80
+ mock_message.key = b'\xff\x83\x00' # Invalid UTF-8 bytes
81
+ mock_message.value = json.dumps({'value': 'test_value'}).encode('utf-8')
82
+ mock_message.partition = 1
83
+ mock_message.offset = 100
84
+ mock_message.timestamp = 1234567890
85
+ mock_message.topic = 'test_topic'
86
+
87
+ # Configure source without RAW_VALUE
88
+ config = {
89
+ 'bootstrap_server': 'dummy',
90
+ 'consumer_group': 'test',
91
+ 'topic': 'test_topic',
92
+ 'include_metadata': True
93
+ }
94
+
95
+ source = KafkaSource(config)
96
+
97
+ # Test message conversion - should fallback to raw bytes
98
+ result = source._convert_message(mock_message)
99
+
100
+ self.assertIsInstance(result, dict)
101
+ self.assertIn('metadata', result)
102
+ self.assertIn('key', result['metadata'])
103
+ # Should fallback to raw bytes when decode fails
104
+ self.assertEqual(result['metadata']['key'], b'\xff\x83\x00')
105
+ self.assertIsInstance(result['data'], dict)