mage-ai 0.9.46__py3-none-any.whl → 0.9.47__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.
- mage_ai/api/operations/base.py +27 -5
- mage_ai/api/policies/GlobalHookPolicy.py +1 -1
- mage_ai/api/policies/IntegrationSourcePolicy.py +62 -0
- mage_ai/api/policies/OauthPolicy.py +6 -6
- mage_ai/api/presenters/GlobalHookPresenter.py +1 -1
- mage_ai/api/presenters/IntegrationSourcePresenter.py +9 -2
- mage_ai/api/presenters/PipelinePresenter.py +2 -0
- mage_ai/api/presenters/PipelineRunPresenter.py +8 -3
- mage_ai/api/presenters/PipelineSchedulePresenter.py +22 -1
- mage_ai/api/resources/BlockResource.py +5 -0
- mage_ai/api/resources/DataProviderResource.py +2 -0
- mage_ai/api/resources/IntegrationSourceResource.py +149 -2
- mage_ai/data_integrations/sources/constants.py +5 -0
- mage_ai/data_integrations/utils/scheduler.py +57 -2
- mage_ai/data_preparation/executors/block_executor.py +9 -1
- mage_ai/data_preparation/models/block/__init__.py +25 -12
- mage_ai/data_preparation/models/block/data_integration/constants.py +3 -0
- mage_ai/data_preparation/models/block/data_integration/utils.py +196 -37
- mage_ai/data_preparation/models/block/sql/utils/shared.py +18 -1
- mage_ai/data_preparation/models/block/utils.py +28 -13
- mage_ai/data_preparation/models/global_hooks/constants.py +50 -1
- mage_ai/data_preparation/models/global_hooks/models.py +148 -84
- mage_ai/data_preparation/models/global_hooks/predicates.py +316 -0
- mage_ai/data_preparation/models/pipeline.py +2 -0
- mage_ai/data_preparation/models/pipelines/integration_pipeline.py +0 -1
- mage_ai/data_preparation/preferences.py +29 -18
- mage_ai/data_preparation/repo_manager.py +12 -2
- mage_ai/data_preparation/sync/__init__.py +2 -0
- mage_ai/data_preparation/templates/constants.py +14 -0
- mage_ai/data_preparation/templates/data_exporters/chroma.py +24 -0
- mage_ai/data_preparation/templates/data_exporters/streaming/rabbitmq.yaml +7 -0
- mage_ai/data_preparation/templates/data_loaders/chroma.py +27 -0
- mage_ai/data_preparation/templates/repo/io_config.yaml +3 -0
- mage_ai/io/base.py +1 -0
- mage_ai/io/chroma.py +153 -0
- mage_ai/io/config.py +8 -0
- mage_ai/orchestration/db/models/schedules.py +98 -34
- mage_ai/orchestration/pipeline_scheduler.py +58 -19
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/N3FS4bHv0jpYeeg672uYK/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{1749-9a6276b2918fdae1.js → 1749-bf512b4dabbab7fa.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{1952-ac7722e8b1ab88fe.js → 1952-57858e7445d24413.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/2714-1e79e9f2e998b544.js → frontend_dist/_next/static/chunks/2714-68fef54789d7eaeb.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2717-92cdffd87b6f6e05.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3419-f8d518d024e7b5c8.js → frontend_dist/_next/static/chunks/3419-715ca383fa15a5ef.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3437-b4d6a037cf5781f8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3943-c9fb980f03df6450.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4267-cb102e060a43d9bd.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/4366-93e09e5a4a7e182c.js → frontend_dist/_next/static/chunks/4366-3e52497942acbafe.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{4783-1a21d9be47574bba.js → 4783-422429203610c318.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-e26a0768db1cfdba.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{5896-14e5a23b1c6a0769.js → 5896-7b8e36634d7d94eb.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{6285-e9b45335bfb9ccaf.js → 6285-648f9a732e100b2f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6798-b904395b0c18647b.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/7022-070ec0144a4d029c.js → frontend_dist/_next/static/chunks/7022-e76cae3ba5ee5312.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-900f786d24f91b2e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{7361-694e1e4fb9c97d68.js → 7361-6c5c9063b9f91700.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/8146-92e7ccfed169ee9c.js → frontend_dist/_next/static/chunks/8146-27f0e31f309897a5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/845-9a73c65fe3fdc328.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8487-8e1c09546dff4dbf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9264-cc44b07f248707b0.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/9618-4eb49cdbd1ba11d7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{976-18c98af60b76f1a7.js → 976-0a8c2c4d7acd957b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-78c4a077a2f279c2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-b37d221eb5ddc248.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-7adc543fc490367a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-51d366993f6dd449.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/{files-449a022f2f0f2d94.js → files-fe6e73463a20d67c.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{manage-f83deb790548693b.js → manage-d8a38b5d1f50e798.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-9adc2974aada27ba.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-51b1311dff2a974e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-2333e524d34b474a.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-6d1afeb4a84f50f7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1ff9bb8e22ca1e75.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-11363aa58d51f4e1.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-779c3ef0676a12ac.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-bbea9a088657404a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-3737f2b0afc2ede3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-3c8f062913c66f3e.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-c1f4ed17d501ccca.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-8bdd858240d5dbf6.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-dd4fb405695f74bf.js +1 -0
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +5 -5
- mage_ai/server/frontend_dist/files.html +5 -5
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-data-products.html +5 -5
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +5 -5
- mage_ai/server/frontend_dist/global-hooks.html +5 -5
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +5 -5
- mage_ai/server/frontend_dist/manage/settings.html +5 -5
- mage_ai/server/frontend_dist/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist/manage/users.html +5 -5
- mage_ai/server/frontend_dist/manage.html +5 -5
- mage_ai/server/frontend_dist/oauth.html +4 -4
- mage_ai/server/frontend_dist/overview.html +5 -5
- mage_ai/server/frontend_dist/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +5 -5
- mage_ai/server/frontend_dist/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +20 -20
- mage_ai/server/frontend_dist/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist/templates.html +5 -5
- mage_ai/server/frontend_dist/terminal.html +5 -5
- mage_ai/server/frontend_dist/test.html +5 -5
- mage_ai/server/frontend_dist/triggers.html +5 -5
- mage_ai/server/frontend_dist/version-control.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/_next/static/aoO6jYZLVlUGCCdY-wmy8/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1749-9a6276b2918fdae1.js → 1749-bf512b4dabbab7fa.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1952-ac7722e8b1ab88fe.js → 1952-57858e7445d24413.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/2714-1e79e9f2e998b544.js → frontend_dist_base_path_template/_next/static/chunks/2714-68fef54789d7eaeb.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2717-92cdffd87b6f6e05.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3419-f8d518d024e7b5c8.js → frontend_dist_base_path_template/_next/static/chunks/3419-715ca383fa15a5ef.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3437-b4d6a037cf5781f8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-c9fb980f03df6450.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-cb102e060a43d9bd.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/4366-93e09e5a4a7e182c.js → frontend_dist_base_path_template/_next/static/chunks/4366-3e52497942acbafe.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4783-1a21d9be47574bba.js → 4783-422429203610c318.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-e26a0768db1cfdba.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{5896-14e5a23b1c6a0769.js → 5896-7b8e36634d7d94eb.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{6285-e9b45335bfb9ccaf.js → 6285-648f9a732e100b2f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6798-b904395b0c18647b.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/7022-070ec0144a4d029c.js → frontend_dist_base_path_template/_next/static/chunks/7022-e76cae3ba5ee5312.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-900f786d24f91b2e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7361-694e1e4fb9c97d68.js → 7361-6c5c9063b9f91700.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/8146-92e7ccfed169ee9c.js → frontend_dist_base_path_template/_next/static/chunks/8146-27f0e31f309897a5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/845-9a73c65fe3fdc328.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8487-8e1c09546dff4dbf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-cc44b07f248707b0.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-4eb49cdbd1ba11d7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{976-18c98af60b76f1a7.js → 976-0a8c2c4d7acd957b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-78c4a077a2f279c2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-b37d221eb5ddc248.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-7adc543fc490367a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-51d366993f6dd449.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/{files-449a022f2f0f2d94.js → files-fe6e73463a20d67c.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{manage-f83deb790548693b.js → manage-d8a38b5d1f50e798.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-9adc2974aada27ba.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-51b1311dff2a974e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-2333e524d34b474a.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-e051057d9fe94f23.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-6d1afeb4a84f50f7.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1ff9bb8e22ca1e75.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-11363aa58d51f4e1.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-779c3ef0676a12ac.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-bbea9a088657404a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-3737f2b0afc2ede3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-3c8f062913c66f3e.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-c1f4ed17d501ccca.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-8bdd858240d5dbf6.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-dd4fb405695f74bf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/compute.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/manage.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/oauth.html +4 -4
- mage_ai/server/frontend_dist_base_path_template/overview.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +23 -23
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/terminal.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/test.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/triggers.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/version-control.html +5 -5
- mage_ai/server/server.py +9 -3
- mage_ai/services/k8s/job_manager.py +1 -0
- mage_ai/settings/repo.py +3 -0
- mage_ai/shared/files.py +47 -0
- mage_ai/shared/models.py +1 -0
- mage_ai/streaming/constants.py +1 -0
- mage_ai/streaming/sinks/postgres.py +2 -0
- mage_ai/streaming/sinks/rabbitmq.py +76 -0
- mage_ai/streaming/sinks/sink_factory.py +4 -0
- mage_ai/tests/api/operations/test_operations_with_hooks.py +136 -91
- mage_ai/tests/api/policies/test_oauth_policy.py +38 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_global_hooks.py +33 -8
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +82 -38
- mage_ai/tests/data_preparation/models/global_hooks/test_predicates.py +803 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_utils.py +6 -1
- mage_ai/tests/data_preparation/models/test_block.py +26 -0
- mage_ai/tests/data_preparation/models/test_pipeline.py +10 -0
- mage_ai/tests/factory.py +40 -2
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +82 -1
- mage_ai/tests/services/k8s/test_job_manager.py +16 -0
- mage_ai/tests/shared/mixins.py +60 -23
- mage_ai/tests/streaming/sinks/test_rabbitmq.py +36 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/METADATA +7 -4
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/RECORD +257 -243
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/WHEEL +1 -1
- mage_ai/server/frontend_dist/_next/static/9jB4XPuz6BzxBcG9VNao5/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3943-9e1105393a3be0de.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4267-fd4d8049e83178de.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5810-12eadc488265d55b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/595-0d174b1f9fbfce4f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/6333-bc1b433b428a9095.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/722-a1584445357a276c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8487-032ef9b17d20aad9.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9264-1d4f0327d42fed91.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9618-2c5045255ac5a6e7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-0691711636fa95c7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-572d82d6eb7a5d43.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3943-9e1105393a3be0de.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4267-fd4d8049e83178de.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5810-12eadc488265d55b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/595-0d174b1f9fbfce4f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/6333-bc1b433b428a9095.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/722-a1584445357a276c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8487-032ef9b17d20aad9.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9264-1d4f0327d42fed91.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9618-2c5045255ac5a6e7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-ebef928183f9a3bb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/files-0f2d4be6fdca86ca.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks/[...slug]-77edfa32d000e88b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-hooks-e561ae38cf5592e8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-10e9a2d19541caa2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-c8d3a5289ab93f88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-ff7e9108502f5716.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-0691711636fa95c7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-2914e326a5f1ffe0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers/[...slug]-3a7500e6e53084d3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-c0e551d265a8d467.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-e47db5c3eaf683af.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/profile-55ac955dfa9a5a8d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-29c92a9bc54ae5cd.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-572d82d6eb7a5d43.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-2d26d80370a2e481.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/uPDjJYpJMst1q6psbRyte/_buildManifest.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{9jB4XPuz6BzxBcG9VNao5 → N3FS4bHv0jpYeeg672uYK}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{uPDjJYpJMst1q6psbRyte → aoO6jYZLVlUGCCdY-wmy8}/_ssgManifest.js +0 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.46.dist-info → mage_ai-0.9.47.dist-info}/top_level.txt +0 -0
mage_ai/api/operations/base.py
CHANGED
|
@@ -61,6 +61,7 @@ class BaseOperation():
|
|
|
61
61
|
self.oauth_token = kwargs.get('oauth_token')
|
|
62
62
|
self.options = kwargs.get('options', {})
|
|
63
63
|
self.payload = kwargs.get('payload') or {}
|
|
64
|
+
self.payload_mutated = None
|
|
64
65
|
self._query = kwargs.get('query', {}) or {}
|
|
65
66
|
self.resource = kwargs.get('resource')
|
|
66
67
|
self.resource_parent = kwargs.get('resource_parent')
|
|
@@ -96,6 +97,7 @@ class BaseOperation():
|
|
|
96
97
|
condition=HookCondition.SUCCESS,
|
|
97
98
|
metadata=metadata,
|
|
98
99
|
operation_resource=result,
|
|
100
|
+
payload=self.payload_mutated,
|
|
99
101
|
**{
|
|
100
102
|
resource_key: presented_init,
|
|
101
103
|
},
|
|
@@ -221,6 +223,7 @@ class BaseOperation():
|
|
|
221
223
|
error=self.__present_error(err),
|
|
222
224
|
metadata=metadata,
|
|
223
225
|
operation_resource=result,
|
|
226
|
+
payload=self.payload_mutated,
|
|
224
227
|
**{
|
|
225
228
|
resource_key: presented_init,
|
|
226
229
|
},
|
|
@@ -269,8 +272,14 @@ class BaseOperation():
|
|
|
269
272
|
operation_type: HookOperation,
|
|
270
273
|
stage: HookStage,
|
|
271
274
|
condition: HookCondition = None,
|
|
275
|
+
error: Dict = None,
|
|
276
|
+
meta: Dict = None,
|
|
277
|
+
metadata: Dict = None,
|
|
272
278
|
operation_resource: Union[BaseResource, Dict, List[BaseResource]] = None,
|
|
273
|
-
|
|
279
|
+
payload: Dict = None,
|
|
280
|
+
query: Dict = None,
|
|
281
|
+
resource: Dict = None,
|
|
282
|
+
resources: List[Dict] = None,
|
|
274
283
|
) -> List[Hook]:
|
|
275
284
|
project = Project()
|
|
276
285
|
if not project.is_feature_enabled(FeatureUUID.GLOBAL_HOOKS):
|
|
@@ -283,12 +292,21 @@ class BaseOperation():
|
|
|
283
292
|
try:
|
|
284
293
|
global_hooks = GlobalHooks.load_from_file()
|
|
285
294
|
hooks = global_hooks.get_and_run_hooks(
|
|
295
|
+
operation_types,
|
|
296
|
+
EntityName(self.__classified_class()),
|
|
297
|
+
stage,
|
|
286
298
|
conditions=[condition] if condition else None,
|
|
299
|
+
error=error,
|
|
300
|
+
meta=meta,
|
|
301
|
+
metadata=metadata,
|
|
287
302
|
operation_resource=operation_resource,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
303
|
+
payload=payload,
|
|
304
|
+
query=query,
|
|
305
|
+
resource=resource,
|
|
306
|
+
resource_id=self.pk,
|
|
307
|
+
resource_parent_id=self.resource_parent_id,
|
|
308
|
+
resources=resources,
|
|
309
|
+
user=dict(id=self.user.id) if self.user else None,
|
|
292
310
|
)
|
|
293
311
|
except Exception:
|
|
294
312
|
hooks = []
|
|
@@ -309,6 +327,7 @@ class BaseOperation():
|
|
|
309
327
|
error: Dict = None,
|
|
310
328
|
metadata: Dict = None,
|
|
311
329
|
operation_resource: Union[BaseResource, List[BaseResource]] = None,
|
|
330
|
+
payload: Dict = None,
|
|
312
331
|
resource: Dict = None,
|
|
313
332
|
resources: List[Dict] = None,
|
|
314
333
|
) -> Union[Dict, List[Dict]]:
|
|
@@ -319,6 +338,7 @@ class BaseOperation():
|
|
|
319
338
|
metadata=metadata,
|
|
320
339
|
operation_resource=operation_resource,
|
|
321
340
|
operation_type=HookOperation(self.action),
|
|
341
|
+
payload=payload,
|
|
322
342
|
query=self.query,
|
|
323
343
|
resource=resource,
|
|
324
344
|
resources=resources,
|
|
@@ -399,6 +419,8 @@ class BaseOperation():
|
|
|
399
419
|
if isinstance(value, dict):
|
|
400
420
|
self.query = merge_dict(self.query, value)
|
|
401
421
|
|
|
422
|
+
self.payload_mutated = payload
|
|
423
|
+
|
|
402
424
|
return payload
|
|
403
425
|
|
|
404
426
|
async def __executed_result(self) -> Union[BaseResource, Dict, List[BaseResource]]:
|
|
@@ -14,6 +14,19 @@ IntegrationSourcePolicy.allow_actions([
|
|
|
14
14
|
OauthScope.CLIENT_PRIVATE,
|
|
15
15
|
], condition=lambda policy: policy.has_at_least_viewer_role())
|
|
16
16
|
|
|
17
|
+
|
|
18
|
+
IntegrationSourcePolicy.allow_actions(
|
|
19
|
+
[
|
|
20
|
+
constants.DETAIL,
|
|
21
|
+
],
|
|
22
|
+
scopes=[
|
|
23
|
+
OauthScope.CLIENT_PRIVATE,
|
|
24
|
+
],
|
|
25
|
+
condition=lambda policy: policy.has_at_least_viewer_role(),
|
|
26
|
+
override_permission_condition=lambda _policy: True,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
|
|
17
30
|
IntegrationSourcePolicy.allow_actions([
|
|
18
31
|
constants.CREATE,
|
|
19
32
|
constants.UPDATE,
|
|
@@ -21,6 +34,7 @@ IntegrationSourcePolicy.allow_actions([
|
|
|
21
34
|
OauthScope.CLIENT_PRIVATE,
|
|
22
35
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
23
36
|
|
|
37
|
+
|
|
24
38
|
IntegrationSourcePolicy.allow_read(IntegrationSourcePresenter.default_attributes + [
|
|
25
39
|
'docs'
|
|
26
40
|
], scopes=[
|
|
@@ -29,6 +43,20 @@ IntegrationSourcePolicy.allow_read(IntegrationSourcePresenter.default_attributes
|
|
|
29
43
|
constants.LIST,
|
|
30
44
|
], condition=lambda policy: policy.has_at_least_viewer_role())
|
|
31
45
|
|
|
46
|
+
|
|
47
|
+
IntegrationSourcePolicy.allow_read(
|
|
48
|
+
IntegrationSourcePresenter.default_attributes,
|
|
49
|
+
scopes=[
|
|
50
|
+
OauthScope.CLIENT_PRIVATE,
|
|
51
|
+
],
|
|
52
|
+
on_action=[
|
|
53
|
+
constants.DETAIL,
|
|
54
|
+
],
|
|
55
|
+
condition=lambda policy: policy.has_at_least_viewer_role(),
|
|
56
|
+
override_permission_condition=lambda _policy: True,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
|
|
32
60
|
IntegrationSourcePolicy.allow_read([
|
|
33
61
|
'error_message',
|
|
34
62
|
'streams',
|
|
@@ -39,6 +67,7 @@ IntegrationSourcePolicy.allow_read([
|
|
|
39
67
|
constants.CREATE,
|
|
40
68
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
41
69
|
|
|
70
|
+
|
|
42
71
|
IntegrationSourcePolicy.allow_read([
|
|
43
72
|
'selected_streams',
|
|
44
73
|
'streams',
|
|
@@ -49,6 +78,7 @@ IntegrationSourcePolicy.allow_read([
|
|
|
49
78
|
constants.UPDATE,
|
|
50
79
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
51
80
|
|
|
81
|
+
|
|
52
82
|
IntegrationSourcePolicy.allow_write([
|
|
53
83
|
'action_type',
|
|
54
84
|
'block_uuid',
|
|
@@ -61,6 +91,7 @@ IntegrationSourcePolicy.allow_write([
|
|
|
61
91
|
constants.CREATE,
|
|
62
92
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
63
93
|
|
|
94
|
+
|
|
64
95
|
IntegrationSourcePolicy.allow_write([
|
|
65
96
|
'block_uuid',
|
|
66
97
|
'streams',
|
|
@@ -69,3 +100,34 @@ IntegrationSourcePolicy.allow_write([
|
|
|
69
100
|
], on_action=[
|
|
70
101
|
constants.UPDATE,
|
|
71
102
|
], condition=lambda policy: policy.has_at_least_editor_role())
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
IntegrationSourcePolicy.allow_query(
|
|
106
|
+
[
|
|
107
|
+
'block_uuid[]',
|
|
108
|
+
],
|
|
109
|
+
scopes=[
|
|
110
|
+
OauthScope.CLIENT_PRIVATE,
|
|
111
|
+
],
|
|
112
|
+
on_action=[
|
|
113
|
+
constants.LIST,
|
|
114
|
+
],
|
|
115
|
+
condition=lambda policy: policy.has_at_least_viewer_role(),
|
|
116
|
+
override_permission_condition=lambda _policy: True,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
IntegrationSourcePolicy.allow_query(
|
|
121
|
+
[
|
|
122
|
+
'pipeline_schedule_id',
|
|
123
|
+
'stream',
|
|
124
|
+
],
|
|
125
|
+
scopes=[
|
|
126
|
+
OauthScope.CLIENT_PRIVATE,
|
|
127
|
+
],
|
|
128
|
+
on_action=[
|
|
129
|
+
constants.DETAIL,
|
|
130
|
+
],
|
|
131
|
+
condition=lambda policy: policy.has_at_least_viewer_role(),
|
|
132
|
+
override_permission_condition=lambda _policy: True,
|
|
133
|
+
)
|
|
@@ -46,12 +46,12 @@ class OauthPolicy(BasePolicy, UserPermissionMixIn):
|
|
|
46
46
|
),
|
|
47
47
|
{
|
|
48
48
|
OauthScope.CLIENT_PUBLIC: {
|
|
49
|
-
OperationType.DETAIL: config
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
OperationType.LIST: config
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
OperationType.DETAIL: (config.get(
|
|
50
|
+
OauthScope.CLIENT_PUBLIC,
|
|
51
|
+
) or {}).get(OperationType.DETAIL) or {},
|
|
52
|
+
OperationType.LIST: (config.get(
|
|
53
|
+
OauthScope.CLIENT_PUBLIC,
|
|
54
|
+
) or {}).get(OperationType.LIST) or {},
|
|
55
55
|
},
|
|
56
56
|
},
|
|
57
57
|
)
|
|
@@ -9,13 +9,20 @@ from mage_ai.data_preparation.models.block.data_integration.utils import (
|
|
|
9
9
|
|
|
10
10
|
class IntegrationSourcePresenter(BasePresenter):
|
|
11
11
|
default_attributes = [
|
|
12
|
+
'block',
|
|
12
13
|
'name',
|
|
14
|
+
'partition',
|
|
15
|
+
'pipeline_run',
|
|
16
|
+
'pipeline_schedule',
|
|
17
|
+
'streams',
|
|
13
18
|
'templates',
|
|
14
19
|
'uuid',
|
|
15
20
|
]
|
|
16
21
|
|
|
17
|
-
def
|
|
18
|
-
|
|
22
|
+
async def prepare_present(self, **kwargs):
|
|
23
|
+
display_format = kwargs['format']
|
|
24
|
+
|
|
25
|
+
if constants.UPDATE == display_format:
|
|
19
26
|
payload = (kwargs.get('payload') or {}).get('integration_source') or {}
|
|
20
27
|
|
|
21
28
|
catalog = None
|
|
@@ -20,6 +20,7 @@ class PipelinePresenter(BasePresenter):
|
|
|
20
20
|
'executor_type',
|
|
21
21
|
'name',
|
|
22
22
|
'notification_config',
|
|
23
|
+
'remote_variables_dir',
|
|
23
24
|
'retry_config',
|
|
24
25
|
'run_pipeline_in_one_process',
|
|
25
26
|
'settings',
|
|
@@ -29,6 +30,7 @@ class PipelinePresenter(BasePresenter):
|
|
|
29
30
|
'updated_at',
|
|
30
31
|
'uuid',
|
|
31
32
|
'variables',
|
|
33
|
+
'variables_dir',
|
|
32
34
|
'widgets',
|
|
33
35
|
]
|
|
34
36
|
|
|
@@ -21,7 +21,7 @@ class PipelineRunPresenter(BasePresenter):
|
|
|
21
21
|
'variables',
|
|
22
22
|
]
|
|
23
23
|
|
|
24
|
-
async def
|
|
24
|
+
async def prepare_present(self, **kwargs):
|
|
25
25
|
display_format = kwargs.get('format')
|
|
26
26
|
data_to_display = self.model
|
|
27
27
|
|
|
@@ -92,6 +92,8 @@ PipelineRunPresenter.register_format(
|
|
|
92
92
|
'pipeline_schedule_name',
|
|
93
93
|
'pipeline_schedule_token',
|
|
94
94
|
'pipeline_schedule_type',
|
|
95
|
+
'pipeline_tags',
|
|
96
|
+
'pipeline_type',
|
|
95
97
|
],
|
|
96
98
|
)
|
|
97
99
|
|
|
@@ -102,8 +104,11 @@ PipelineRunPresenter.register_format(
|
|
|
102
104
|
],
|
|
103
105
|
)
|
|
104
106
|
|
|
105
|
-
PipelineRunPresenter.
|
|
106
|
-
|
|
107
|
+
PipelineRunPresenter.register_formats(
|
|
108
|
+
[
|
|
109
|
+
f'integration_source/{constants.DETAIL}',
|
|
110
|
+
'with_basic_details',
|
|
111
|
+
],
|
|
107
112
|
[
|
|
108
113
|
'execution_date',
|
|
109
114
|
'id',
|
|
@@ -22,7 +22,7 @@ class PipelineSchedulePresenter(BasePresenter):
|
|
|
22
22
|
'variables',
|
|
23
23
|
]
|
|
24
24
|
|
|
25
|
-
async def
|
|
25
|
+
async def prepare_present(self, **kwargs):
|
|
26
26
|
display_format = kwargs['format']
|
|
27
27
|
data = self.model.to_dict()
|
|
28
28
|
next_execution_date = self.model.next_execution_date()
|
|
@@ -59,8 +59,10 @@ PipelineSchedulePresenter.register_format(
|
|
|
59
59
|
PipelineSchedulePresenter.default_attributes + [
|
|
60
60
|
'event_matchers',
|
|
61
61
|
'last_pipeline_run_status',
|
|
62
|
+
'next_pipeline_run_date',
|
|
62
63
|
'pipeline_in_progress_runs_count',
|
|
63
64
|
'pipeline_runs_count',
|
|
65
|
+
'tags',
|
|
64
66
|
],
|
|
65
67
|
)
|
|
66
68
|
|
|
@@ -69,6 +71,8 @@ PipelineSchedulePresenter.register_formats([
|
|
|
69
71
|
constants.UPDATE,
|
|
70
72
|
], PipelineSchedulePresenter.default_attributes + [
|
|
71
73
|
'event_matchers',
|
|
74
|
+
'next_pipeline_run_date',
|
|
75
|
+
'tags',
|
|
72
76
|
],
|
|
73
77
|
)
|
|
74
78
|
|
|
@@ -76,6 +80,23 @@ PipelineSchedulePresenter.register_formats([
|
|
|
76
80
|
PipelineSchedulePresenter.register_formats([
|
|
77
81
|
'with_runtime_average',
|
|
78
82
|
], PipelineSchedulePresenter.default_attributes + [
|
|
83
|
+
'next_pipeline_run_date',
|
|
79
84
|
'runtime_average',
|
|
85
|
+
'tags',
|
|
86
|
+
],
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
PipelineSchedulePresenter.register_formats(
|
|
91
|
+
[
|
|
92
|
+
f'integration_source/{constants.DETAIL}',
|
|
93
|
+
],
|
|
94
|
+
[
|
|
95
|
+
'id',
|
|
96
|
+
'name',
|
|
97
|
+
'schedule_interval',
|
|
98
|
+
'schedule_type',
|
|
99
|
+
'settings',
|
|
100
|
+
'variables',
|
|
80
101
|
],
|
|
81
102
|
)
|
|
@@ -267,6 +267,11 @@ class BlockResource(GenericResource):
|
|
|
267
267
|
':'.join(parts_new),
|
|
268
268
|
)
|
|
269
269
|
|
|
270
|
+
if metrics.get('dynamic_upstream_block_uuids'):
|
|
271
|
+
block_mapping[block_run_block_uuid]['uuids'].extend(
|
|
272
|
+
metrics.get('dynamic_upstream_block_uuids') or [],
|
|
273
|
+
)
|
|
274
|
+
|
|
270
275
|
# If it should reduce, then all the children have 1 downstream.
|
|
271
276
|
if should_reduce_output(block):
|
|
272
277
|
for db in block.downstream_blocks:
|
|
@@ -8,6 +8,7 @@ from mage_ai.settings.repo import get_repo_path
|
|
|
8
8
|
|
|
9
9
|
DATA_PROVIDERS = [
|
|
10
10
|
DataSource.BIGQUERY,
|
|
11
|
+
DataSource.CHROMA,
|
|
11
12
|
DataSource.CLICKHOUSE,
|
|
12
13
|
DataSource.DRUID,
|
|
13
14
|
DataSource.DUCKDB,
|
|
@@ -21,6 +22,7 @@ DATA_PROVIDERS = [
|
|
|
21
22
|
]
|
|
22
23
|
DATA_PROVIDERS_NAME = {
|
|
23
24
|
DataSource.BIGQUERY: 'BigQuery',
|
|
25
|
+
DataSource.CHROMA: 'Chroma',
|
|
24
26
|
DataSource.CLICKHOUSE: 'ClickHouse',
|
|
25
27
|
DataSource.DUCKDB: 'DuckDB',
|
|
26
28
|
DataSource.DRUID: 'Druid',
|
|
@@ -1,22 +1,131 @@
|
|
|
1
1
|
import traceback
|
|
2
|
+
import urllib.parse
|
|
3
|
+
from typing import Dict, List
|
|
2
4
|
|
|
3
5
|
from mage_ai.api.resources.GenericResource import GenericResource
|
|
6
|
+
from mage_ai.api.resources.PipelineRunResource import PipelineRunResource
|
|
7
|
+
from mage_ai.api.resources.PipelineScheduleResource import PipelineScheduleResource
|
|
4
8
|
from mage_ai.data_integrations.sources.constants import SOURCES
|
|
5
|
-
from mage_ai.data_preparation.models.block.data_integration.
|
|
9
|
+
from mage_ai.data_preparation.models.block.data_integration.constants import (
|
|
10
|
+
KEY_REPLICATION_METHOD,
|
|
11
|
+
REPLICATION_METHOD_INCREMENTAL,
|
|
12
|
+
)
|
|
13
|
+
from mage_ai.data_preparation.models.block.data_integration.utils import (
|
|
14
|
+
get_state_data,
|
|
15
|
+
test_connection,
|
|
16
|
+
)
|
|
6
17
|
from mage_ai.data_preparation.models.constants import BlockType
|
|
7
18
|
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
8
19
|
from mage_ai.data_preparation.models.pipelines.integration_pipeline import (
|
|
9
20
|
IntegrationPipeline,
|
|
10
21
|
)
|
|
11
22
|
from mage_ai.orchestration.db import safe_db_query
|
|
23
|
+
from mage_ai.orchestration.db.models.schedules import PipelineRun
|
|
12
24
|
from mage_ai.server.api.integration_sources import get_collection
|
|
13
25
|
|
|
14
26
|
|
|
27
|
+
def get_state_data_for_blocks(
|
|
28
|
+
pipeline: Pipeline,
|
|
29
|
+
block_uuids: List[str],
|
|
30
|
+
pipeline_schedule_id: int = None,
|
|
31
|
+
stream: str = None,
|
|
32
|
+
) -> List[Dict]:
|
|
33
|
+
arr = []
|
|
34
|
+
|
|
35
|
+
for block_uuid in block_uuids:
|
|
36
|
+
block = pipeline.get_block(block_uuid)
|
|
37
|
+
|
|
38
|
+
data_integration_uuid = None
|
|
39
|
+
execution_partition_previous = None
|
|
40
|
+
pipeline_run = None
|
|
41
|
+
pipeline_schedule = None
|
|
42
|
+
state_data_by_stream = {}
|
|
43
|
+
|
|
44
|
+
pipeline_runs = PipelineRun.recently_completed_pipeline_runs(
|
|
45
|
+
pipeline.uuid,
|
|
46
|
+
pipeline_schedule_id=pipeline_schedule_id,
|
|
47
|
+
sample_size=1,
|
|
48
|
+
)
|
|
49
|
+
if pipeline_runs:
|
|
50
|
+
pipeline_run = pipeline_runs[0]
|
|
51
|
+
execution_partition_previous = pipeline_run.execution_partition
|
|
52
|
+
pipeline_schedule = pipeline_run.pipeline_schedule
|
|
53
|
+
|
|
54
|
+
if execution_partition_previous:
|
|
55
|
+
settings = block.get_data_integration_settings(
|
|
56
|
+
partition=execution_partition_previous,
|
|
57
|
+
)
|
|
58
|
+
catalog = settings.get('catalog')
|
|
59
|
+
|
|
60
|
+
if catalog and catalog.get('streams'):
|
|
61
|
+
for stream_dict in (catalog.get('streams') or []):
|
|
62
|
+
stream_id = stream_dict.get('tap_stream_id') or stream_dict.get('stream')
|
|
63
|
+
if stream and stream != stream_id:
|
|
64
|
+
continue
|
|
65
|
+
|
|
66
|
+
if REPLICATION_METHOD_INCREMENTAL != stream_dict.get(
|
|
67
|
+
KEY_REPLICATION_METHOD,
|
|
68
|
+
):
|
|
69
|
+
continue
|
|
70
|
+
|
|
71
|
+
data_integration_uuid = settings.get('data_integration_uuid')
|
|
72
|
+
state_data, record = get_state_data(
|
|
73
|
+
block,
|
|
74
|
+
catalog,
|
|
75
|
+
data_integration_uuid=data_integration_uuid,
|
|
76
|
+
include_record=True,
|
|
77
|
+
partition=execution_partition_previous,
|
|
78
|
+
stream_id=stream_id,
|
|
79
|
+
)
|
|
80
|
+
state_data_by_stream[stream_id] = dict(
|
|
81
|
+
record=record,
|
|
82
|
+
state=state_data,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
arr.append(dict(
|
|
86
|
+
block=block.to_dict(),
|
|
87
|
+
partition=execution_partition_previous,
|
|
88
|
+
pipeline_run=pipeline_run,
|
|
89
|
+
pipeline_schedule=pipeline_schedule,
|
|
90
|
+
streams=state_data_by_stream,
|
|
91
|
+
uuid=data_integration_uuid,
|
|
92
|
+
))
|
|
93
|
+
|
|
94
|
+
return arr
|
|
95
|
+
|
|
96
|
+
|
|
15
97
|
class IntegrationSourceResource(GenericResource):
|
|
16
98
|
@classmethod
|
|
17
99
|
@safe_db_query
|
|
18
100
|
async def collection(self, query, meta, user, **kwargs):
|
|
19
|
-
collection =
|
|
101
|
+
collection = []
|
|
102
|
+
|
|
103
|
+
parent_model = kwargs.get('parent_model')
|
|
104
|
+
if parent_model and isinstance(parent_model, Pipeline):
|
|
105
|
+
block_uuids = query.get('block_uuid[]', [])
|
|
106
|
+
if block_uuids:
|
|
107
|
+
block_uuids = block_uuids[0]
|
|
108
|
+
if block_uuids:
|
|
109
|
+
block_uuids = block_uuids.split(',')
|
|
110
|
+
|
|
111
|
+
for state_data in get_state_data_for_blocks(parent_model, block_uuids):
|
|
112
|
+
if state_data.get('pipeline_run'):
|
|
113
|
+
state_data['pipeline_run'] = PipelineRunResource(
|
|
114
|
+
state_data['pipeline_run'],
|
|
115
|
+
user,
|
|
116
|
+
**kwargs,
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
if state_data.get('pipeline_schedule'):
|
|
120
|
+
state_data['pipeline_schedule'] = PipelineScheduleResource(
|
|
121
|
+
state_data['pipeline_schedule'],
|
|
122
|
+
user,
|
|
123
|
+
**kwargs,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
collection.append(state_data)
|
|
127
|
+
else:
|
|
128
|
+
collection = get_collection('sources', SOURCES)
|
|
20
129
|
|
|
21
130
|
return self.build_result_set(
|
|
22
131
|
collection,
|
|
@@ -75,4 +184,42 @@ class IntegrationSourceResource(GenericResource):
|
|
|
75
184
|
@classmethod
|
|
76
185
|
@safe_db_query
|
|
77
186
|
def member(self, pk, user, **kwargs):
|
|
187
|
+
parent_model = kwargs.get('parent_model')
|
|
188
|
+
query = kwargs.get('query', {})
|
|
189
|
+
|
|
190
|
+
pipeline_schedule_id = query.get('pipeline_schedule_id', [None])
|
|
191
|
+
if pipeline_schedule_id:
|
|
192
|
+
pipeline_schedule_id = pipeline_schedule_id[0]
|
|
193
|
+
|
|
194
|
+
stream = query.get('stream', [None])
|
|
195
|
+
if stream:
|
|
196
|
+
stream = stream[0]
|
|
197
|
+
|
|
198
|
+
if parent_model and isinstance(parent_model, Pipeline):
|
|
199
|
+
block_uuid = urllib.parse.unquote(pk)
|
|
200
|
+
state_data_arr = get_state_data_for_blocks(
|
|
201
|
+
parent_model,
|
|
202
|
+
[block_uuid],
|
|
203
|
+
pipeline_schedule_id=pipeline_schedule_id,
|
|
204
|
+
stream=stream,
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
state_data = state_data_arr[0]
|
|
208
|
+
|
|
209
|
+
if state_data.get('pipeline_run'):
|
|
210
|
+
state_data['pipeline_run'] = PipelineRunResource(
|
|
211
|
+
state_data['pipeline_run'],
|
|
212
|
+
user,
|
|
213
|
+
**kwargs,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
if state_data.get('pipeline_schedule'):
|
|
217
|
+
state_data['pipeline_schedule'] = PipelineScheduleResource(
|
|
218
|
+
state_data['pipeline_schedule'],
|
|
219
|
+
user,
|
|
220
|
+
**kwargs,
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
return self(state_data, user, **kwargs)
|
|
224
|
+
|
|
78
225
|
return self(IntegrationPipeline.get(pk), user, **kwargs)
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from mage_ai.data_integrations.utils.settings import get_uuid
|
|
2
|
+
from mage_ai.shared.hash import index_by
|
|
3
|
+
|
|
1
4
|
SQL_SOURCES = [
|
|
2
5
|
dict(name='BigQuery'),
|
|
3
6
|
dict(
|
|
@@ -11,6 +14,8 @@ SQL_SOURCES = [
|
|
|
11
14
|
dict(name='Snowflake'),
|
|
12
15
|
]
|
|
13
16
|
|
|
17
|
+
SQL_SOURCES_MAPPING = index_by(get_uuid, SQL_SOURCES)
|
|
18
|
+
|
|
14
19
|
SOURCES = sorted([
|
|
15
20
|
dict(name='Amazon S3'),
|
|
16
21
|
dict(name='Amplitude'),
|