mage-ai 0.9.67__py3-none-any.whl → 0.9.68__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.
Potentially problematic release.
This version of mage-ai might be problematic. Click here for more details.
- mage_ai/api/monitors/BaseMonitor.py +1 -2
- mage_ai/api/policies/PipelinePolicy.py +2 -0
- mage_ai/api/resources/BlockLayoutItemResource.py +2 -2
- mage_ai/api/resources/BlockResource.py +4 -3
- mage_ai/api/resources/CacheItemResource.py +1 -1
- mage_ai/api/resources/GitBranchResource.py +3 -5
- mage_ai/api/resources/PageBlockLayoutResource.py +2 -2
- mage_ai/api/resources/PipelineResource.py +13 -0
- mage_ai/api/resources/PipelineRunResource.py +10 -1
- mage_ai/cache/tag.py +3 -0
- mage_ai/cluster_manager/manage.py +4 -1
- mage_ai/data_preparation/executors/k8s_block_executor.py +8 -1
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +12 -1
- mage_ai/data_preparation/logging/gcs_logger_manager.py +7 -4
- mage_ai/data_preparation/models/block/__init__.py +21 -68
- mage_ai/data_preparation/models/block/block_factory.py +77 -0
- mage_ai/data_preparation/models/block/dbt/block.py +5 -7
- mage_ai/data_preparation/models/block/global_data_product/__init__.py +9 -3
- mage_ai/data_preparation/models/block/integration/__init__.py +12 -8
- mage_ai/data_preparation/models/block/platform/mixins.py +1 -1
- mage_ai/data_preparation/models/pipeline.py +80 -13
- mage_ai/data_preparation/storage/gcs_storage.py +1 -1
- mage_ai/data_preparation/templates/constants.py +7 -0
- mage_ai/io/export_utils.py +3 -0
- mage_ai/io/oracledb.py +138 -3
- mage_ai/io/sql.py +4 -0
- mage_ai/orchestration/db/__init__.py +2 -2
- mage_ai/orchestration/db/models/schedules.py +2 -2
- mage_ai/orchestration/notification/sender.py +8 -0
- mage_ai/orchestration/pipeline_scheduler_original.py +10 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +2 -2
- mage_ai/server/frontend_dist/_next/static/chunks/3548-961ff79ca70038c7.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{4241-ccd0126f5750cc35.js → 4241-4499461184ba0d23.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5627-237a3de578538022.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{7966-5c1786fb7e7a48f5.js → 7966-f07b2913f7326b50.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-08790743315de36a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/index-13760bb72d823b69.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-8bbfa0c19b5e4cb3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-852d403c7bda21b3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-597b74828bf105db.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-bd0aff5a5ed8888c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-d1ee961387c58b7f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-90abafc7ed61c582.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cb88fd075a357fcf.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-ceb06e1616ee9610.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-8ff16ef9566e911a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-d7a8bc51bb7a1082.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-f59d34429fe022ee.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-9cba3211434a8966.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/khKiaJtwrslgMmp4YSa1f → frontend_dist/_next/static/i8pymuJDTVHdWjUP1QSh1}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist/block-layout.html +2 -2
- mage_ai/server/frontend_dist/compute.html +2 -2
- mage_ai/server/frontend_dist/files.html +2 -2
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-data-products.html +2 -2
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/index.html +2 -2
- mage_ai/server/frontend_dist/manage/files.html +2 -2
- mage_ai/server/frontend_dist/manage/settings.html +2 -2
- mage_ai/server/frontend_dist/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist/manage/users.html +2 -2
- mage_ai/server/frontend_dist/manage.html +2 -2
- mage_ai/server/frontend_dist/oauth.html +3 -3
- mage_ai/server/frontend_dist/overview.html +2 -2
- mage_ai/server/frontend_dist/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist/pipelines.html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist/platform/global-hooks.html +2 -2
- mage_ai/server/frontend_dist/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/platform/settings.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist/settings.html +2 -2
- mage_ai/server/frontend_dist/sign-in.html +5 -5
- mage_ai/server/frontend_dist/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist/templates.html +2 -2
- mage_ai/server/frontend_dist/terminal.html +2 -2
- mage_ai/server/frontend_dist/test.html +2 -2
- mage_ai/server/frontend_dist/triggers.html +2 -2
- mage_ai/server/frontend_dist/version-control.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/404.html +2 -2
- mage_ai/server/{frontend_dist/_next/static/vPsMu6Fi2zrHaf2fRXKRO → frontend_dist_base_path_template/_next/static/CKCvjsYCf2imD2X8zAOBf}/_buildManifest.js +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-961ff79ca70038c7.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{4241-ccd0126f5750cc35.js → 4241-4499461184ba0d23.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5627-237a3de578538022.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{7966-5c1786fb7e7a48f5.js → 7966-f07b2913f7326b50.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-08790743315de36a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-13760bb72d823b69.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-8bbfa0c19b5e4cb3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-852d403c7bda21b3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-597b74828bf105db.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-bd0aff5a5ed8888c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-d1ee961387c58b7f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-90abafc7ed61c582.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-cb88fd075a357fcf.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-ceb06e1616ee9610.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-8ff16ef9566e911a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-d7a8bc51bb7a1082.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-f59d34429fe022ee.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-9cba3211434a8966.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 +2 -2
- mage_ai/server/frontend_dist_base_path_template/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/index.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/manage.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/oauth.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/overview.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +2 -2
- 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 +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/settings.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +2 -2
- mage_ai/server/frontend_dist_base_path_template/templates.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/terminal.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/test.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/triggers.html +2 -2
- mage_ai/server/frontend_dist_base_path_template/version-control.html +2 -2
- mage_ai/services/k8s/job_manager.py +8 -0
- mage_ai/services/slack/slack.py +10 -1
- mage_ai/services/spark/spark.py +9 -2
- mage_ai/settings/backends.py +8 -8
- mage_ai/settings/models/configuration_option.py +10 -9
- mage_ai/shared/files.py +19 -1
- mage_ai/shared/path_fixer.py +3 -0
- mage_ai/streaming/sources/base.py +5 -0
- mage_ai/streaming/sources/kafka.py +2 -1
- mage_ai/streaming/sources/mongodb.py +4 -0
- mage_ai/tests/data_preparation/models/block/dbt/test_block.py +2 -2
- mage_ai/tests/data_preparation/models/block/dbt/test_block_sql.py +1 -1
- mage_ai/tests/data_preparation/models/block/dbt/test_block_yaml.py +1 -1
- mage_ai/tests/data_preparation/models/test_block.py +2 -1
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +2 -0
- mage_ai/tests/settings/models/test_configuration_option.py +2 -2
- {mage_ai-0.9.67.dist-info → mage_ai-0.9.68.dist-info}/METADATA +3 -3
- {mage_ai-0.9.67.dist-info → mage_ai-0.9.68.dist-info}/RECORD +207 -206
- mage_ai/server/frontend_dist/_next/static/chunks/181-e61915415a976861.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3548-13563a1ff815f922.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-1c1ffd928f5a00f7.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/index-b7b8695a7f9efde2.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage/users/[user]-d3a5fd3119fdb1e4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/manage-42789d698d28a92f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/overview-d05040edba41b2ac.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-aaf393c86fc1bda3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-36377e679da2cd91.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1b688d61f8efe07a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-ed3331d22d5cff7d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/syncs-d94e48bad89ba1e0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/triggers-f508c2f261297724.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines-f99e99aa8f45529c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-6826000cdffc36b8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-dde29a463495cebb.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/sign-in-7d38b2f7c3e918a1.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/triggers-ab98a7b3a678669e.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/181-e61915415a976861.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3548-13563a1ff815f922.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-1c1ffd928f5a00f7.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/index-b7b8695a7f9efde2.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage/users/[user]-d3a5fd3119fdb1e4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/manage-42789d698d28a92f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/overview-d05040edba41b2ac.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-aaf393c86fc1bda3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-36377e679da2cd91.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1b688d61f8efe07a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-ed3331d22d5cff7d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/syncs-d94e48bad89ba1e0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/triggers-f508c2f261297724.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines-f99e99aa8f45529c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-6826000cdffc36b8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-dde29a463495cebb.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/sign-in-7d38b2f7c3e918a1.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/triggers-ab98a7b3a678669e.js +0 -1
- /mage_ai/server/frontend_dist/_next/static/{vPsMu6Fi2zrHaf2fRXKRO → i8pymuJDTVHdWjUP1QSh1}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{khKiaJtwrslgMmp4YSa1f → CKCvjsYCf2imD2X8zAOBf}/_ssgManifest.js +0 -0
- {mage_ai-0.9.67.dist-info → mage_ai-0.9.68.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.67.dist-info → mage_ai-0.9.68.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.67.dist-info → mage_ai-0.9.68.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.67.dist-info → mage_ai-0.9.68.dist-info}/top_level.txt +0 -0
|
@@ -24,8 +24,6 @@ class BaseMonitor:
|
|
|
24
24
|
if self.error.type:
|
|
25
25
|
data['type'] = self.error.type
|
|
26
26
|
|
|
27
|
-
loop = asyncio.get_event_loop()
|
|
28
|
-
|
|
29
27
|
kwargs = dict(
|
|
30
28
|
resource=self.resource,
|
|
31
29
|
**extract(
|
|
@@ -48,6 +46,7 @@ class BaseMonitor:
|
|
|
48
46
|
),
|
|
49
47
|
)
|
|
50
48
|
|
|
49
|
+
loop = asyncio.get_event_loop()
|
|
51
50
|
if loop is not None:
|
|
52
51
|
loop.create_task(
|
|
53
52
|
UsageStatisticLogger().error(
|
|
@@ -6,7 +6,7 @@ import urllib.parse
|
|
|
6
6
|
|
|
7
7
|
from mage_ai.api.errors import ApiError
|
|
8
8
|
from mage_ai.api.resources.GenericResource import GenericResource
|
|
9
|
-
from mage_ai.data_preparation.models.block import
|
|
9
|
+
from mage_ai.data_preparation.models.block.block_factory import BlockFactory
|
|
10
10
|
from mage_ai.data_preparation.models.constants import BlockType
|
|
11
11
|
from mage_ai.data_preparation.models.widget.constants import ChartType
|
|
12
12
|
from mage_ai.data_preparation.variable_manager import get_global_variables
|
|
@@ -73,7 +73,7 @@ class BlockLayoutItemResource(GenericResource):
|
|
|
73
73
|
data_source_type = data_source_config.get('type')
|
|
74
74
|
pipeline_uuid = data_source_config.get('pipeline_uuid')
|
|
75
75
|
|
|
76
|
-
block =
|
|
76
|
+
block = BlockFactory.get_block(
|
|
77
77
|
block_config.get('name') or file_path or uuid,
|
|
78
78
|
block_uuid,
|
|
79
79
|
block_type,
|
|
@@ -12,6 +12,7 @@ from mage_ai.cache.block_action_object.constants import (
|
|
|
12
12
|
OBJECT_TYPE_MAGE_TEMPLATE,
|
|
13
13
|
)
|
|
14
14
|
from mage_ai.data_preparation.models.block import Block
|
|
15
|
+
from mage_ai.data_preparation.models.block.block_factory import BlockFactory
|
|
15
16
|
from mage_ai.data_preparation.models.block.utils import clean_name
|
|
16
17
|
from mage_ai.data_preparation.models.constants import (
|
|
17
18
|
FILE_EXTENSION_TO_BLOCK_LANGUAGE,
|
|
@@ -163,7 +164,7 @@ class BlockResource(GenericResource):
|
|
|
163
164
|
if payload.get('type') == BlockType.DBT and language == BlockLanguage.SQL and content:
|
|
164
165
|
from mage_ai.data_preparation.models.block.dbt import DBTBlock
|
|
165
166
|
|
|
166
|
-
dbt_block = DBTBlock(
|
|
167
|
+
dbt_block = DBTBlock.create(
|
|
167
168
|
name,
|
|
168
169
|
clean_name(name),
|
|
169
170
|
BlockType.DBT,
|
|
@@ -323,7 +324,7 @@ class BlockResource(GenericResource):
|
|
|
323
324
|
if BlockType.DBT == block_type:
|
|
324
325
|
from mage_ai.data_preparation.models.block.dbt import DBTBlock
|
|
325
326
|
|
|
326
|
-
block = DBTBlock(
|
|
327
|
+
block = DBTBlock.create(
|
|
327
328
|
block_uuid,
|
|
328
329
|
block_uuid,
|
|
329
330
|
block_type,
|
|
@@ -331,7 +332,7 @@ class BlockResource(GenericResource):
|
|
|
331
332
|
language=language,
|
|
332
333
|
)
|
|
333
334
|
else:
|
|
334
|
-
block =
|
|
335
|
+
block = BlockFactory.get_block(block_uuid, block_uuid, block_type, language=language)
|
|
335
336
|
|
|
336
337
|
if not block.exists():
|
|
337
338
|
error.update(ApiError.RESOURCE_NOT_FOUND)
|
|
@@ -152,14 +152,10 @@ class GitBranchResource(GenericResource):
|
|
|
152
152
|
)
|
|
153
153
|
http_access_token = git_manager.get_access_token()
|
|
154
154
|
|
|
155
|
+
config_overwrite = None
|
|
155
156
|
token = None
|
|
156
157
|
if access_token:
|
|
157
158
|
token = access_token.token
|
|
158
|
-
elif http_access_token:
|
|
159
|
-
token = http_access_token
|
|
160
|
-
|
|
161
|
-
config_overwrite = None
|
|
162
|
-
if token:
|
|
163
159
|
user_from_api = api.get_user(token, provider=provider)
|
|
164
160
|
# Default to mage user email if no email is returned from API
|
|
165
161
|
email = user_from_api.get(
|
|
@@ -169,6 +165,8 @@ class GitBranchResource(GenericResource):
|
|
|
169
165
|
username=user_from_api.get('username'),
|
|
170
166
|
email=email,
|
|
171
167
|
)
|
|
168
|
+
elif http_access_token:
|
|
169
|
+
token = http_access_token
|
|
172
170
|
|
|
173
171
|
# Recreate git manager with updated config
|
|
174
172
|
git_manager = self.get_git_manager(
|
|
@@ -3,7 +3,7 @@ import urllib.parse
|
|
|
3
3
|
|
|
4
4
|
from mage_ai.api.errors import ApiError
|
|
5
5
|
from mage_ai.api.resources.GenericResource import GenericResource
|
|
6
|
-
from mage_ai.data_preparation.models.block import
|
|
6
|
+
from mage_ai.data_preparation.models.block.block_factory import BlockFactory
|
|
7
7
|
from mage_ai.presenters.block_layout.page import PageBlockLayout
|
|
8
8
|
from mage_ai.shared.hash import extract, ignore_keys, merge_dict
|
|
9
9
|
from mage_ai.shared.utils import clean_name
|
|
@@ -52,7 +52,7 @@ class PageBlockLayoutResource(GenericResource):
|
|
|
52
52
|
if len(parts) >= 2:
|
|
53
53
|
block_uuid_use = os.path.join(*parts[1:])
|
|
54
54
|
|
|
55
|
-
block =
|
|
55
|
+
block = BlockFactory.get_block(
|
|
56
56
|
block_uuid_use,
|
|
57
57
|
block_uuid_use,
|
|
58
58
|
block_type,
|
|
@@ -362,6 +362,8 @@ class PipelineResource(BaseResource):
|
|
|
362
362
|
clone_pipeline_uuid = payload.get('clone_pipeline_uuid')
|
|
363
363
|
template_uuid = payload.get('custom_template_uuid')
|
|
364
364
|
name = payload.get('name')
|
|
365
|
+
description = payload.get('description')
|
|
366
|
+
tags = payload.get('tags')
|
|
365
367
|
pipeline_type = payload.get('type')
|
|
366
368
|
llm_payload = payload.get('llm')
|
|
367
369
|
pipeline = None
|
|
@@ -375,8 +377,10 @@ class PipelineResource(BaseResource):
|
|
|
375
377
|
else:
|
|
376
378
|
pipeline = Pipeline.create(
|
|
377
379
|
name,
|
|
380
|
+
description=description,
|
|
378
381
|
pipeline_type=pipeline_type,
|
|
379
382
|
repo_path=get_repo_path(),
|
|
383
|
+
tags=tags,
|
|
380
384
|
)
|
|
381
385
|
|
|
382
386
|
if llm_payload:
|
|
@@ -451,6 +455,15 @@ class PipelineResource(BaseResource):
|
|
|
451
455
|
cache = await PipelineCache.initialize_cache()
|
|
452
456
|
cache.add_model(resource.model)
|
|
453
457
|
|
|
458
|
+
tags = resource.model.tags
|
|
459
|
+
if tags:
|
|
460
|
+
from mage_ai.cache.tag import TagCache
|
|
461
|
+
|
|
462
|
+
cache = await TagCache.initialize_cache()
|
|
463
|
+
|
|
464
|
+
for tag_uuid in tags:
|
|
465
|
+
cache.add_pipeline(tag_uuid, resource.model)
|
|
466
|
+
|
|
454
467
|
self.on_create_callback = _on_create_callback
|
|
455
468
|
|
|
456
469
|
return self(pipeline, user, **kwargs)
|
|
@@ -12,7 +12,7 @@ from mage_ai.data_preparation.models.triggers import (
|
|
|
12
12
|
ScheduleStatus,
|
|
13
13
|
ScheduleType,
|
|
14
14
|
)
|
|
15
|
-
from mage_ai.orchestration.db import safe_db_query
|
|
15
|
+
from mage_ai.orchestration.db import db_connection, safe_db_query
|
|
16
16
|
from mage_ai.orchestration.db.models.schedules import (
|
|
17
17
|
BlockRun,
|
|
18
18
|
PipelineRun,
|
|
@@ -241,6 +241,15 @@ class PipelineRunResource(DatabaseResource):
|
|
|
241
241
|
has_next = results_size > limit
|
|
242
242
|
final_end_idx = results_size - 1 if has_next else results_size
|
|
243
243
|
|
|
244
|
+
# Expire pipeline runs that are in progress so that the latest status is returned
|
|
245
|
+
# the next time they are fetched.
|
|
246
|
+
for run in results:
|
|
247
|
+
if run.status in (
|
|
248
|
+
PipelineRun.PipelineRunStatus.RUNNING,
|
|
249
|
+
PipelineRun.PipelineRunStatus.INITIAL,
|
|
250
|
+
):
|
|
251
|
+
db_connection.session.expire(run)
|
|
252
|
+
|
|
244
253
|
result_set = self.build_result_set(
|
|
245
254
|
results[0:final_end_idx],
|
|
246
255
|
user,
|
mage_ai/cache/tag.py
CHANGED
|
@@ -144,6 +144,9 @@ class TagCache(BaseCache):
|
|
|
144
144
|
|
|
145
145
|
mapping[key][KEY_FOR_PIPELINES] = pipelines_dict
|
|
146
146
|
|
|
147
|
+
if not pipelines_dict and mapping[key].keys() == set([KEY_FOR_PIPELINES]):
|
|
148
|
+
mapping.pop(key, None)
|
|
149
|
+
|
|
147
150
|
self.set(self.cache_key, mapping)
|
|
148
151
|
|
|
149
152
|
async def initialize_cache_for_all_objects(self) -> None:
|
|
@@ -70,11 +70,14 @@ def get_workspaces(cluster_type: ClusterType, **kwargs) -> List[Workspace]:
|
|
|
70
70
|
repo_path = get_repo_path()
|
|
71
71
|
projects_folder = os.path.join(repo_path, 'projects')
|
|
72
72
|
if is_main_project:
|
|
73
|
+
# sort by file last modified time
|
|
73
74
|
projects = [
|
|
74
|
-
f
|
|
75
|
+
f
|
|
75
76
|
for f in os.scandir(projects_folder)
|
|
76
77
|
if not f.is_dir() and f.name.endswith('.yaml')
|
|
77
78
|
]
|
|
79
|
+
projects.sort(key=lambda f: os.path.getmtime(f.path), reverse=True)
|
|
80
|
+
projects = [os.path.splitext(f.name)[0] for f in projects]
|
|
78
81
|
else:
|
|
79
82
|
instances = get_instances(cluster_type, **kwargs)
|
|
80
83
|
projects = [instance.get('name') for instance in instances]
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
from typing import Dict
|
|
2
2
|
|
|
3
|
+
from jinja2 import Template
|
|
4
|
+
|
|
3
5
|
from mage_ai.data_preparation.executors.block_executor import BlockExecutor
|
|
6
|
+
from mage_ai.data_preparation.shared.utils import get_template_vars
|
|
4
7
|
from mage_ai.services.k8s.config import K8sExecutorConfig
|
|
5
8
|
from mage_ai.services.k8s.constants import DEFAULT_NAMESPACE
|
|
6
9
|
from mage_ai.services.k8s.job_manager import JobManager as K8sJobManager
|
|
@@ -29,9 +32,13 @@ class K8sBlockExecutor(BlockExecutor):
|
|
|
29
32
|
job_name_prefix = self.executor_config.job_name_prefix
|
|
30
33
|
|
|
31
34
|
if self.executor_config.namespace:
|
|
32
|
-
namespace = self.executor_config.namespace
|
|
35
|
+
namespace = Template(self.executor_config.namespace).render(
|
|
36
|
+
variables=lambda x: global_vars.get(x) if global_vars else None,
|
|
37
|
+
**get_template_vars()
|
|
38
|
+
)
|
|
33
39
|
else:
|
|
34
40
|
namespace = DEFAULT_NAMESPACE
|
|
41
|
+
|
|
35
42
|
job_manager = K8sJobManager(
|
|
36
43
|
job_name=f'mage-{job_name_prefix}-block-{block_run_id}',
|
|
37
44
|
logger=self.logger,
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import traceback
|
|
2
2
|
from typing import Dict
|
|
3
3
|
|
|
4
|
+
from jinja2 import Template
|
|
5
|
+
|
|
4
6
|
from mage_ai.data_preparation.executors.pipeline_executor import PipelineExecutor
|
|
5
7
|
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
8
|
+
from mage_ai.data_preparation.shared.utils import get_template_vars
|
|
6
9
|
from mage_ai.services.k8s.config import K8sExecutorConfig
|
|
7
10
|
from mage_ai.services.k8s.constants import DEFAULT_NAMESPACE
|
|
8
11
|
from mage_ai.services.k8s.job_manager import JobManager as K8sJobManager
|
|
@@ -39,6 +42,7 @@ class K8sPipelineExecutor(PipelineExecutor):
|
|
|
39
42
|
) -> None:
|
|
40
43
|
job_manager = self.get_job_manager(
|
|
41
44
|
pipeline_run_id=pipeline_run_id,
|
|
45
|
+
global_vars=global_vars,
|
|
42
46
|
**kwargs,
|
|
43
47
|
)
|
|
44
48
|
cmd = self._run_commands(
|
|
@@ -54,15 +58,22 @@ class K8sPipelineExecutor(PipelineExecutor):
|
|
|
54
58
|
def get_job_manager(
|
|
55
59
|
self,
|
|
56
60
|
pipeline_run_id: int = None,
|
|
61
|
+
global_vars: Dict = None,
|
|
57
62
|
**kwargs,
|
|
58
63
|
) -> K8sJobManager:
|
|
64
|
+
if global_vars is None:
|
|
65
|
+
global_vars = dict()
|
|
59
66
|
if not self.executor_config.job_name_prefix:
|
|
60
67
|
job_name_prefix = 'data-prep'
|
|
61
68
|
else:
|
|
62
69
|
job_name_prefix = self.executor_config.job_name_prefix
|
|
63
70
|
|
|
64
71
|
if self.executor_config.namespace:
|
|
65
|
-
|
|
72
|
+
|
|
73
|
+
namespace = Template(self.executor_config.namespace).render(
|
|
74
|
+
variables=lambda x: global_vars.get(x) if global_vars else None,
|
|
75
|
+
**get_template_vars()
|
|
76
|
+
)
|
|
66
77
|
else:
|
|
67
78
|
namespace = DEFAULT_NAMESPACE
|
|
68
79
|
|
|
@@ -10,9 +10,9 @@ from mage_ai.shared.config import BaseConfig
|
|
|
10
10
|
|
|
11
11
|
@dataclass
|
|
12
12
|
class GCSConfig(BaseConfig):
|
|
13
|
-
path_to_credentials: str
|
|
14
13
|
bucket: str
|
|
15
14
|
prefix: str
|
|
15
|
+
path_to_credentials: str = None
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class GCSLoggerManager(LoggerManager):
|
|
@@ -23,9 +23,12 @@ class GCSLoggerManager(LoggerManager):
|
|
|
23
23
|
):
|
|
24
24
|
super().__init__(repo_config=repo_config, **kwargs)
|
|
25
25
|
self.gcs_config = GCSConfig.load(config=self.logging_config.destination_config)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
if self.gcs_config.path_to_credentials:
|
|
27
|
+
credentials = service_account.Credentials.from_service_account_file(
|
|
28
|
+
self.gcs_config.path_to_credentials
|
|
29
|
+
)
|
|
30
|
+
else:
|
|
31
|
+
credentials = None
|
|
29
32
|
self.gcs_client = storage.Client(credentials=credentials)
|
|
30
33
|
|
|
31
34
|
def create_log_filepath_dir(self, path):
|
|
@@ -90,7 +90,7 @@ from mage_ai.data_preparation.templates.data_integrations.utils import get_templ
|
|
|
90
90
|
from mage_ai.data_preparation.templates.template import load_template
|
|
91
91
|
from mage_ai.server.kernel_output_parser import DataType
|
|
92
92
|
from mage_ai.services.spark.config import SparkConfig
|
|
93
|
-
from mage_ai.services.spark.spark import get_spark_session
|
|
93
|
+
from mage_ai.services.spark.spark import SPARK_ENABLED, get_spark_session
|
|
94
94
|
from mage_ai.settings.platform.constants import project_platform_activated
|
|
95
95
|
from mage_ai.settings.repo import get_repo_path
|
|
96
96
|
from mage_ai.shared.array import unique_by
|
|
@@ -723,41 +723,6 @@ class Block(DataIntegrationMixin, SparkBlock, ProjectPlatformAccessible):
|
|
|
723
723
|
widget=widget,
|
|
724
724
|
)
|
|
725
725
|
|
|
726
|
-
@classmethod
|
|
727
|
-
def block_class_from_type(self, block_type: str, language=None, pipeline=None) -> 'Block':
|
|
728
|
-
from mage_ai.data_preparation.models.block.constants import BLOCK_TYPE_TO_CLASS
|
|
729
|
-
from mage_ai.data_preparation.models.block.integration import (
|
|
730
|
-
DestinationBlock,
|
|
731
|
-
SourceBlock,
|
|
732
|
-
TransformerBlock,
|
|
733
|
-
)
|
|
734
|
-
from mage_ai.data_preparation.models.block.r import RBlock
|
|
735
|
-
from mage_ai.data_preparation.models.block.sql import SQLBlock
|
|
736
|
-
from mage_ai.data_preparation.models.widget import Widget
|
|
737
|
-
|
|
738
|
-
if BlockType.CHART == block_type:
|
|
739
|
-
return Widget
|
|
740
|
-
elif BlockType.DBT == block_type:
|
|
741
|
-
from mage_ai.data_preparation.models.block.dbt import DBTBlock
|
|
742
|
-
|
|
743
|
-
return DBTBlock
|
|
744
|
-
elif pipeline and PipelineType.INTEGRATION == pipeline.type:
|
|
745
|
-
if BlockType.CALLBACK == block_type:
|
|
746
|
-
return CallbackBlock
|
|
747
|
-
elif BlockType.CONDITIONAL == block_type:
|
|
748
|
-
return ConditionalBlock
|
|
749
|
-
elif BlockType.DATA_LOADER == block_type:
|
|
750
|
-
return SourceBlock
|
|
751
|
-
elif BlockType.DATA_EXPORTER == block_type:
|
|
752
|
-
return DestinationBlock
|
|
753
|
-
else:
|
|
754
|
-
return TransformerBlock
|
|
755
|
-
elif BlockLanguage.SQL == language:
|
|
756
|
-
return SQLBlock
|
|
757
|
-
elif BlockLanguage.R == language:
|
|
758
|
-
return RBlock
|
|
759
|
-
return BLOCK_TYPE_TO_CLASS.get(block_type)
|
|
760
|
-
|
|
761
726
|
@classmethod
|
|
762
727
|
def create(
|
|
763
728
|
self,
|
|
@@ -777,6 +742,8 @@ class Block(DataIntegrationMixin, SparkBlock, ProjectPlatformAccessible):
|
|
|
777
742
|
widget: bool = False,
|
|
778
743
|
downstream_block_uuids: List[str] = None,
|
|
779
744
|
) -> 'Block':
|
|
745
|
+
from mage_ai.data_preparation.models.block.block_factory import BlockFactory
|
|
746
|
+
|
|
780
747
|
"""
|
|
781
748
|
1. Create a new folder for block_type if not exist
|
|
782
749
|
2. Create a new python file with code template
|
|
@@ -870,7 +837,11 @@ class Block(DataIntegrationMixin, SparkBlock, ProjectPlatformAccessible):
|
|
|
870
837
|
language,
|
|
871
838
|
)
|
|
872
839
|
|
|
873
|
-
block =
|
|
840
|
+
block = BlockFactory.block_class_from_type(
|
|
841
|
+
block_type,
|
|
842
|
+
language=language,
|
|
843
|
+
pipeline=pipeline,
|
|
844
|
+
)(
|
|
874
845
|
name,
|
|
875
846
|
uuid,
|
|
876
847
|
block_type,
|
|
@@ -931,34 +902,6 @@ class Block(DataIntegrationMixin, SparkBlock, ProjectPlatformAccessible):
|
|
|
931
902
|
block_uuids[t.value].append(f.split('.')[0])
|
|
932
903
|
return block_uuids
|
|
933
904
|
|
|
934
|
-
@classmethod
|
|
935
|
-
def get_block(
|
|
936
|
-
self,
|
|
937
|
-
name,
|
|
938
|
-
uuid,
|
|
939
|
-
block_type,
|
|
940
|
-
configuration=None,
|
|
941
|
-
content=None,
|
|
942
|
-
language=None,
|
|
943
|
-
pipeline=None,
|
|
944
|
-
status=BlockStatus.NOT_EXECUTED,
|
|
945
|
-
) -> 'Block':
|
|
946
|
-
block_class = self.block_class_from_type(
|
|
947
|
-
block_type,
|
|
948
|
-
language=language,
|
|
949
|
-
pipeline=pipeline,
|
|
950
|
-
) or Block
|
|
951
|
-
return block_class(
|
|
952
|
-
name,
|
|
953
|
-
uuid,
|
|
954
|
-
block_type,
|
|
955
|
-
configuration=configuration,
|
|
956
|
-
content=content,
|
|
957
|
-
language=language,
|
|
958
|
-
pipeline=pipeline,
|
|
959
|
-
status=status,
|
|
960
|
-
)
|
|
961
|
-
|
|
962
905
|
@classmethod
|
|
963
906
|
def get_block_from_file_path(self, file_path: str) -> 'Block':
|
|
964
907
|
parts = get_path_parts(file_path)
|
|
@@ -2445,8 +2388,10 @@ df = get_variable('{self.pipeline.uuid}', '{self.uuid}', 'df')
|
|
|
2445
2388
|
return Template(self.executor_type).render(**get_template_vars())
|
|
2446
2389
|
return self.executor_type
|
|
2447
2390
|
|
|
2448
|
-
def get_pipelines_from_cache(self) -> List[Dict]:
|
|
2449
|
-
|
|
2391
|
+
def get_pipelines_from_cache(self, block_cache: BlockCache = None) -> List[Dict]:
|
|
2392
|
+
if block_cache is None:
|
|
2393
|
+
block_cache = BlockCache()
|
|
2394
|
+
arr = block_cache.get_pipelines(self)
|
|
2450
2395
|
|
|
2451
2396
|
return unique_by(
|
|
2452
2397
|
arr,
|
|
@@ -2497,11 +2442,13 @@ df = get_variable('{self.pipeline.uuid}', '{self.uuid}', 'df')
|
|
|
2497
2442
|
def to_dict(
|
|
2498
2443
|
self,
|
|
2499
2444
|
include_block_catalog: bool = False,
|
|
2445
|
+
include_block_pipelines: bool = False,
|
|
2500
2446
|
include_callback_blocks: bool = False,
|
|
2501
2447
|
include_content: bool = False,
|
|
2502
2448
|
include_outputs: bool = False,
|
|
2503
2449
|
include_outputs_spark: bool = False,
|
|
2504
2450
|
sample_count: int = None,
|
|
2451
|
+
block_cache: BlockCache = None,
|
|
2505
2452
|
check_if_file_exists: bool = False,
|
|
2506
2453
|
**kwargs,
|
|
2507
2454
|
) -> Dict:
|
|
@@ -2515,6 +2462,9 @@ df = get_variable('{self.pipeline.uuid}', '{self.uuid}', 'df')
|
|
|
2515
2462
|
if include_block_catalog and self.is_data_integration() and self.pipeline:
|
|
2516
2463
|
data['catalog'] = self.get_catalog_from_file()
|
|
2517
2464
|
|
|
2465
|
+
if include_block_pipelines:
|
|
2466
|
+
data['pipelines'] = self.get_pipelines_from_cache(block_cache=block_cache)
|
|
2467
|
+
|
|
2518
2468
|
if include_outputs:
|
|
2519
2469
|
include_outputs_use = include_outputs
|
|
2520
2470
|
if self.is_using_spark() and self.compute_management_enabled():
|
|
@@ -2551,6 +2501,7 @@ df = get_variable('{self.pipeline.uuid}', '{self.uuid}', 'df')
|
|
|
2551
2501
|
include_outputs: bool = False,
|
|
2552
2502
|
include_outputs_spark: bool = False,
|
|
2553
2503
|
sample_count: int = None,
|
|
2504
|
+
block_cache: BlockCache = None,
|
|
2554
2505
|
check_if_file_exists: bool = False,
|
|
2555
2506
|
**kwargs,
|
|
2556
2507
|
) -> Dict:
|
|
@@ -2596,7 +2547,7 @@ df = get_variable('{self.pipeline.uuid}', '{self.uuid}', 'df')
|
|
|
2596
2547
|
data['tags'] = self.tags()
|
|
2597
2548
|
|
|
2598
2549
|
if include_block_pipelines:
|
|
2599
|
-
data['pipelines'] = self.get_pipelines_from_cache()
|
|
2550
|
+
data['pipelines'] = self.get_pipelines_from_cache(block_cache=block_cache)
|
|
2600
2551
|
|
|
2601
2552
|
return data
|
|
2602
2553
|
|
|
@@ -3093,6 +3044,8 @@ df = get_variable('{self.pipeline.uuid}', '{self.uuid}', 'df')
|
|
|
3093
3044
|
return global_vars
|
|
3094
3045
|
|
|
3095
3046
|
def get_spark_session(self):
|
|
3047
|
+
if not SPARK_ENABLED:
|
|
3048
|
+
return None
|
|
3096
3049
|
if self.spark_init and (not self.pipeline or
|
|
3097
3050
|
not self.pipeline.spark_config):
|
|
3098
3051
|
return self.spark
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
from mage_ai.data_preparation.models.block import Block, CallbackBlock, ConditionalBlock
|
|
2
|
+
from mage_ai.data_preparation.models.block.constants import BLOCK_TYPE_TO_CLASS
|
|
3
|
+
from mage_ai.data_preparation.models.block.integration import (
|
|
4
|
+
DestinationBlock,
|
|
5
|
+
SourceBlock,
|
|
6
|
+
TransformerBlock,
|
|
7
|
+
)
|
|
8
|
+
from mage_ai.data_preparation.models.block.r import RBlock
|
|
9
|
+
from mage_ai.data_preparation.models.block.sql import SQLBlock
|
|
10
|
+
from mage_ai.data_preparation.models.constants import (
|
|
11
|
+
BlockLanguage,
|
|
12
|
+
BlockStatus,
|
|
13
|
+
BlockType,
|
|
14
|
+
PipelineType,
|
|
15
|
+
)
|
|
16
|
+
from mage_ai.data_preparation.models.widget import Widget
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
from mage_ai.data_preparation.models.block.dbt.block_sql import DBTBlockSQL
|
|
20
|
+
from mage_ai.data_preparation.models.block.dbt.block_yaml import DBTBlockYAML
|
|
21
|
+
except Exception:
|
|
22
|
+
print('DBT library not installed.')
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class BlockFactory:
|
|
26
|
+
@classmethod
|
|
27
|
+
def block_class_from_type(self, block_type: str, language=None, pipeline=None) -> 'Block':
|
|
28
|
+
if BlockType.CHART == block_type:
|
|
29
|
+
return Widget
|
|
30
|
+
elif BlockType.DBT == block_type:
|
|
31
|
+
if language == BlockLanguage.YAML:
|
|
32
|
+
return DBTBlockYAML
|
|
33
|
+
return DBTBlockSQL
|
|
34
|
+
elif pipeline and PipelineType.INTEGRATION == pipeline.type:
|
|
35
|
+
if BlockType.CALLBACK == block_type:
|
|
36
|
+
return CallbackBlock
|
|
37
|
+
elif BlockType.CONDITIONAL == block_type:
|
|
38
|
+
return ConditionalBlock
|
|
39
|
+
elif BlockType.DATA_LOADER == block_type:
|
|
40
|
+
return SourceBlock
|
|
41
|
+
elif BlockType.DATA_EXPORTER == block_type:
|
|
42
|
+
return DestinationBlock
|
|
43
|
+
else:
|
|
44
|
+
return TransformerBlock
|
|
45
|
+
elif BlockLanguage.SQL == language:
|
|
46
|
+
return SQLBlock
|
|
47
|
+
elif BlockLanguage.R == language:
|
|
48
|
+
return RBlock
|
|
49
|
+
return BLOCK_TYPE_TO_CLASS.get(block_type)
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def get_block(
|
|
53
|
+
self,
|
|
54
|
+
name,
|
|
55
|
+
uuid,
|
|
56
|
+
block_type,
|
|
57
|
+
configuration=None,
|
|
58
|
+
content=None,
|
|
59
|
+
language=None,
|
|
60
|
+
pipeline=None,
|
|
61
|
+
status=BlockStatus.NOT_EXECUTED,
|
|
62
|
+
) -> 'Block':
|
|
63
|
+
block_class = BlockFactory.block_class_from_type(
|
|
64
|
+
block_type,
|
|
65
|
+
language=language,
|
|
66
|
+
pipeline=pipeline,
|
|
67
|
+
) or Block
|
|
68
|
+
return block_class(
|
|
69
|
+
name,
|
|
70
|
+
uuid,
|
|
71
|
+
block_type,
|
|
72
|
+
configuration=configuration,
|
|
73
|
+
content=content,
|
|
74
|
+
language=language,
|
|
75
|
+
pipeline=pipeline,
|
|
76
|
+
status=status,
|
|
77
|
+
)
|
|
@@ -26,19 +26,17 @@ from mage_ai.shared.parsers import encode_complex
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
class DBTBlock(Block):
|
|
29
|
-
|
|
29
|
+
@classmethod
|
|
30
|
+
def create(cls, *args, **kwargs) -> 'DBTBlock':
|
|
30
31
|
"""
|
|
31
32
|
Factory for the child blocks
|
|
32
33
|
"""
|
|
33
34
|
# Import Child blocks here to prevent cycle import
|
|
34
35
|
from mage_ai.data_preparation.models.block.dbt.block_sql import DBTBlockSQL
|
|
35
36
|
from mage_ai.data_preparation.models.block.dbt.block_yaml import DBTBlockYAML
|
|
36
|
-
if
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return super(DBTBlock, cls).__new__(DBTBlockSQL)
|
|
40
|
-
else:
|
|
41
|
-
return super(DBTBlock, cls).__new__(cls, *args, **kwargs)
|
|
37
|
+
if kwargs.get('language', BlockLanguage.SQL) == BlockLanguage.YAML:
|
|
38
|
+
return DBTBlockYAML(*args, **kwargs)
|
|
39
|
+
return DBTBlockSQL(*args, **kwargs)
|
|
42
40
|
|
|
43
41
|
@property
|
|
44
42
|
def base_project_path(self) -> Union[str, os.PathLike]:
|
|
@@ -2,12 +2,15 @@ from logging import Logger
|
|
|
2
2
|
from typing import Dict, List
|
|
3
3
|
|
|
4
4
|
from mage_ai.data_preparation.models.block import Block
|
|
5
|
-
from mage_ai.data_preparation.models.global_data_product import GlobalDataProduct
|
|
6
|
-
from mage_ai.orchestration.triggers import global_data_product as trigger
|
|
7
5
|
|
|
8
6
|
|
|
9
7
|
class GlobalDataProductBlock(Block):
|
|
10
|
-
def get_global_data_product(self)
|
|
8
|
+
def get_global_data_product(self):
|
|
9
|
+
# Avoid circular dependency of Pipeline class
|
|
10
|
+
from mage_ai.data_preparation.models.global_data_product import (
|
|
11
|
+
GlobalDataProduct,
|
|
12
|
+
)
|
|
13
|
+
|
|
11
14
|
override_configuration = (self.configuration or {}).get('global_data_product', {})
|
|
12
15
|
global_data_product = GlobalDataProduct.get(override_configuration.get('uuid'))
|
|
13
16
|
|
|
@@ -31,6 +34,9 @@ class GlobalDataProductBlock(Block):
|
|
|
31
34
|
logging_tags: Dict = None,
|
|
32
35
|
**kwargs,
|
|
33
36
|
) -> List:
|
|
37
|
+
# Avoid circular dependency of Pipeline class
|
|
38
|
+
from mage_ai.orchestration.triggers import global_data_product as trigger
|
|
39
|
+
|
|
34
40
|
trigger.trigger_and_check_status(
|
|
35
41
|
self.get_global_data_product(),
|
|
36
42
|
block=self,
|