mage-ai 0.9.70__py3-none-any.whl → 0.9.71__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/ai/utils/xgboost.py +222 -0
- mage_ai/api/errors.py +37 -25
- mage_ai/api/operations/base.py +13 -1
- mage_ai/api/parsers/PipelineScheduleParser.py +1 -1
- mage_ai/api/policies/BlockOutputPolicy.py +40 -17
- mage_ai/api/policies/GlobalDataProductPolicy.py +91 -41
- mage_ai/api/policies/KernelPolicy.py +55 -32
- mage_ai/api/policies/KernelProcessPolicy.py +56 -0
- mage_ai/api/policies/OutputPolicy.py +73 -41
- mage_ai/api/policies/PipelinePolicy.py +206 -138
- mage_ai/api/presenters/BlockLayoutItemPresenter.py +9 -7
- mage_ai/api/presenters/BlockPresenter.py +1 -1
- mage_ai/api/presenters/GlobalDataProductPresenter.py +6 -1
- mage_ai/api/presenters/KernelPresenter.py +5 -26
- mage_ai/api/presenters/KernelProcessPresenter.py +28 -0
- mage_ai/api/presenters/PipelinePresenter.py +18 -5
- mage_ai/api/presenters/StatusPresenter.py +2 -0
- mage_ai/api/presenters/SyncPresenter.py +25 -0
- mage_ai/api/resources/AutocompleteItemResource.py +1 -1
- mage_ai/api/resources/BlockLayoutItemResource.py +90 -44
- mage_ai/api/resources/BlockOutputResource.py +42 -9
- mage_ai/api/resources/BlockResource.py +4 -3
- mage_ai/api/resources/BlockRunResource.py +27 -22
- mage_ai/api/resources/ClusterResource.py +4 -1
- mage_ai/api/resources/CustomTemplateResource.py +34 -14
- mage_ai/api/resources/DataProviderResource.py +1 -1
- mage_ai/api/resources/ExecutionStateResource.py +3 -1
- mage_ai/api/resources/FileContentResource.py +8 -2
- mage_ai/api/resources/FileResource.py +10 -4
- mage_ai/api/resources/FileVersionResource.py +3 -1
- mage_ai/api/resources/GitBranchResource.py +46 -9
- mage_ai/api/resources/GlobalDataProductResource.py +44 -7
- mage_ai/api/resources/GlobalHookResource.py +4 -1
- mage_ai/api/resources/IntegrationDestinationResource.py +6 -2
- mage_ai/api/resources/IntegrationSourceResource.py +8 -4
- mage_ai/api/resources/IntegrationSourceStreamResource.py +6 -2
- mage_ai/api/resources/KernelProcessResource.py +44 -0
- mage_ai/api/resources/KernelResource.py +25 -3
- mage_ai/api/resources/OutputResource.py +33 -11
- mage_ai/api/resources/PageBlockLayoutResource.py +34 -23
- mage_ai/api/resources/PipelineInteractionResource.py +31 -15
- mage_ai/api/resources/PipelineResource.py +250 -123
- mage_ai/api/resources/PipelineRunResource.py +11 -3
- mage_ai/api/resources/PipelineScheduleResource.py +7 -2
- mage_ai/api/resources/PipelineTriggerResource.py +6 -1
- mage_ai/api/resources/ProjectResource.py +18 -7
- mage_ai/api/resources/SecretResource.py +1 -1
- mage_ai/api/resources/SeedResource.py +8 -1
- mage_ai/api/resources/StatusResource.py +21 -6
- mage_ai/api/resources/SyncResource.py +6 -8
- mage_ai/api/resources/VariableResource.py +46 -26
- mage_ai/api/resources/VersionControlProjectResource.py +9 -2
- mage_ai/api/resources/WidgetResource.py +1 -1
- mage_ai/api/resources/WorkspaceResource.py +1 -1
- mage_ai/api/views.py +47 -40
- mage_ai/authentication/permissions/seed.py +16 -2
- mage_ai/authentication/providers/oidc.py +21 -1
- mage_ai/autocomplete/utils.py +13 -9
- mage_ai/cache/base.py +1 -1
- mage_ai/cache/block.py +18 -12
- mage_ai/cache/block_action_object/__init__.py +32 -4
- mage_ai/cache/file.py +22 -19
- mage_ai/cache/pipeline.py +18 -12
- mage_ai/cli/main.py +1 -0
- mage_ai/cluster_manager/aws/emr_cluster_manager.py +9 -5
- mage_ai/cluster_manager/config.py +2 -2
- mage_ai/cluster_manager/manage.py +1 -1
- mage_ai/cluster_manager/workspace/base.py +1 -1
- mage_ai/command_center/applications/factory.py +10 -7
- mage_ai/command_center/files/factory.py +17 -15
- mage_ai/command_center/utils.py +25 -13
- mage_ai/data/__init__.py +0 -0
- mage_ai/data/constants.py +45 -0
- mage_ai/data/models/__init__.py +0 -0
- mage_ai/data/models/base.py +119 -0
- mage_ai/data/models/constants.py +1 -0
- mage_ai/data/models/generator.py +115 -0
- mage_ai/data/models/manager.py +168 -0
- mage_ai/data/models/pyarrow/__init__.py +0 -0
- mage_ai/data/models/pyarrow/record_batch.py +55 -0
- mage_ai/data/models/pyarrow/shared.py +21 -0
- mage_ai/data/models/pyarrow/table.py +8 -0
- mage_ai/data/models/reader.py +103 -0
- mage_ai/data/models/utils.py +59 -0
- mage_ai/data/models/writer.py +91 -0
- mage_ai/data/tabular/__init__.py +0 -0
- mage_ai/data/tabular/constants.py +23 -0
- mage_ai/data/tabular/mocks.py +19 -0
- mage_ai/data/tabular/models.py +126 -0
- mage_ai/data/tabular/reader.py +602 -0
- mage_ai/data/tabular/utils.py +102 -0
- mage_ai/data/tabular/writer.py +266 -0
- mage_ai/data/variables/__init__.py +0 -0
- mage_ai/data/variables/wrapper.py +54 -0
- mage_ai/data_cleaner/analysis/charts.py +61 -39
- mage_ai/data_cleaner/column_types/column_type_detector.py +53 -31
- mage_ai/data_cleaner/estimators/encoders.py +5 -2
- mage_ai/data_integrations/utils/scheduler.py +16 -11
- mage_ai/data_preparation/decorators.py +1 -0
- mage_ai/data_preparation/executors/block_executor.py +237 -155
- mage_ai/data_preparation/executors/streaming_pipeline_executor.py +1 -1
- mage_ai/data_preparation/git/__init__.py +27 -7
- mage_ai/data_preparation/git/api.py +7 -1
- mage_ai/data_preparation/git/utils.py +22 -16
- mage_ai/data_preparation/logging/logger_manager.py +4 -3
- mage_ai/data_preparation/models/block/__init__.py +1542 -878
- mage_ai/data_preparation/models/block/data_integration/mixins.py +4 -3
- mage_ai/data_preparation/models/block/dynamic/__init__.py +17 -6
- mage_ai/data_preparation/models/block/dynamic/child.py +41 -102
- mage_ai/data_preparation/models/block/dynamic/constants.py +1 -0
- mage_ai/data_preparation/models/block/dynamic/counter.py +296 -0
- mage_ai/data_preparation/models/block/dynamic/data.py +16 -0
- mage_ai/data_preparation/models/block/dynamic/factory.py +163 -0
- mage_ai/data_preparation/models/block/dynamic/models.py +19 -0
- mage_ai/data_preparation/models/block/dynamic/shared.py +92 -0
- mage_ai/data_preparation/models/block/dynamic/utils.py +291 -168
- mage_ai/data_preparation/models/block/dynamic/variables.py +384 -144
- mage_ai/data_preparation/models/block/dynamic/wrappers.py +77 -0
- mage_ai/data_preparation/models/block/extension/utils.py +10 -1
- mage_ai/data_preparation/models/block/global_data_product/__init__.py +10 -1
- mage_ai/data_preparation/models/block/integration/__init__.py +6 -2
- mage_ai/data_preparation/models/block/outputs.py +722 -0
- mage_ai/data_preparation/models/block/platform/mixins.py +7 -8
- mage_ai/data_preparation/models/block/r/__init__.py +56 -38
- mage_ai/data_preparation/models/block/settings/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/dynamic/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/dynamic/constants.py +7 -0
- mage_ai/data_preparation/models/block/settings/dynamic/mixins.py +118 -0
- mage_ai/data_preparation/models/block/settings/dynamic/models.py +31 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/mixins.py +20 -0
- mage_ai/data_preparation/models/block/settings/global_data_products/models.py +46 -0
- mage_ai/data_preparation/models/block/settings/variables/__init__.py +0 -0
- mage_ai/data_preparation/models/block/settings/variables/mixins.py +74 -0
- mage_ai/data_preparation/models/block/settings/variables/models.py +49 -0
- mage_ai/data_preparation/models/block/spark/mixins.py +2 -1
- mage_ai/data_preparation/models/block/sql/__init__.py +30 -5
- mage_ai/data_preparation/models/block/sql/utils/shared.py +21 -3
- mage_ai/data_preparation/models/block/utils.py +127 -70
- mage_ai/data_preparation/models/constants.py +19 -14
- mage_ai/data_preparation/models/custom_templates/custom_block_template.py +18 -13
- mage_ai/data_preparation/models/custom_templates/custom_pipeline_template.py +33 -16
- mage_ai/data_preparation/models/custom_templates/utils.py +1 -1
- mage_ai/data_preparation/models/file.py +41 -28
- mage_ai/data_preparation/models/global_data_product/__init__.py +88 -58
- mage_ai/data_preparation/models/global_hooks/models.py +1 -0
- mage_ai/data_preparation/models/interfaces.py +29 -0
- mage_ai/data_preparation/models/pipeline.py +365 -180
- mage_ai/data_preparation/models/pipelines/integration_pipeline.py +1 -2
- mage_ai/data_preparation/models/pipelines/seed.py +1 -1
- mage_ai/data_preparation/models/project/__init__.py +66 -18
- mage_ai/data_preparation/models/project/constants.py +2 -0
- mage_ai/data_preparation/models/triggers/__init__.py +120 -24
- mage_ai/data_preparation/models/utils.py +467 -17
- mage_ai/data_preparation/models/variable.py +1028 -137
- mage_ai/data_preparation/models/variables/__init__.py +0 -0
- mage_ai/data_preparation/models/variables/cache.py +149 -0
- mage_ai/data_preparation/models/variables/constants.py +72 -0
- mage_ai/data_preparation/models/variables/summarizer.py +336 -0
- mage_ai/data_preparation/models/variables/utils.py +77 -0
- mage_ai/data_preparation/models/widget/__init__.py +63 -41
- mage_ai/data_preparation/models/widget/charts.py +40 -27
- mage_ai/data_preparation/models/widget/constants.py +2 -0
- mage_ai/data_preparation/models/widget/utils.py +3 -3
- mage_ai/data_preparation/preferences.py +3 -3
- mage_ai/data_preparation/repo_manager.py +55 -21
- mage_ai/data_preparation/storage/base_storage.py +2 -2
- mage_ai/data_preparation/storage/gcs_storage.py +7 -4
- mage_ai/data_preparation/storage/local_storage.py +6 -3
- mage_ai/data_preparation/storage/s3_storage.py +5 -2
- mage_ai/data_preparation/templates/data_exporters/streaming/oracledb.yaml +8 -0
- mage_ai/data_preparation/variable_manager.py +281 -76
- mage_ai/io/base.py +3 -2
- mage_ai/io/bigquery.py +1 -0
- mage_ai/io/redshift.py +7 -5
- mage_ai/kernels/__init__.py +0 -0
- mage_ai/kernels/models.py +188 -0
- mage_ai/kernels/utils.py +169 -0
- mage_ai/orchestration/concurrency.py +6 -2
- mage_ai/orchestration/db/__init__.py +1 -0
- mage_ai/orchestration/db/migrations/versions/0227396a216c_add_userproject_table.py +38 -0
- mage_ai/orchestration/db/models/dynamic/__init__.py +0 -0
- mage_ai/orchestration/db/models/dynamic/controller.py +67 -0
- mage_ai/orchestration/db/models/oauth.py +2 -9
- mage_ai/orchestration/db/models/projects.py +10 -0
- mage_ai/orchestration/db/models/schedules.py +204 -187
- mage_ai/orchestration/db/models/schedules_project_platform.py +18 -12
- mage_ai/orchestration/db/models/utils.py +46 -5
- mage_ai/orchestration/metrics/pipeline_run.py +8 -9
- mage_ai/orchestration/notification/sender.py +1 -0
- mage_ai/orchestration/pipeline_scheduler_original.py +32 -8
- mage_ai/orchestration/pipeline_scheduler_project_platform.py +1 -1
- mage_ai/orchestration/run_status_checker.py +11 -4
- mage_ai/orchestration/triggers/api.py +12 -1
- mage_ai/presenters/charts/data_sources/base.py +4 -2
- mage_ai/presenters/charts/data_sources/block.py +15 -9
- mage_ai/presenters/charts/data_sources/chart_code.py +8 -5
- mage_ai/presenters/charts/data_sources/constants.py +1 -0
- mage_ai/presenters/charts/data_sources/system_metrics.py +22 -0
- mage_ai/presenters/interactions/models.py +11 -7
- mage_ai/presenters/pages/loaders/pipelines.py +5 -3
- mage_ai/presenters/pages/models/page_components/pipeline_schedules.py +3 -1
- mage_ai/presenters/utils.py +2 -0
- mage_ai/server/api/blocks.py +2 -1
- mage_ai/server/api/downloads.py +5 -1
- mage_ai/server/api/triggers.py +3 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +5 -5
- mage_ai/server/frontend_dist/_next/static/UZLabyPgcxtZvp0O0EUUS/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1376-22de38b4ad008d8a.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{1557-b3502f3f1aa92ac7.js → 1557-25a7d985d5564fd3.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1668-30b4619b9534519b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/1799-c42db95a015689ee.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/2996-2108b53b9d371d8d.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/3763-61b542dafdbf5754.js → frontend_dist/_next/static/chunks/3763-40780c6d1e4b261d.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-129dd2a2448a2e36.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/3958-bcdfa414ccfa1eb2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4168-97fd1578d1a38315.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/4982-fa5a238b139fbdd2.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/5699-176f445e1313f001.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7162-7dd03f0f605de721.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7779-68d2b72a90c5f925.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/7966-5446a8e43711e2f9.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8023-6c2f172f48dcb99b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/8095-c351b8a735d73e0c.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{main-77fe248a6fbd12d8.js → main-b99d4e30a88d9dc7.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-9fe2d9d07c94e968.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{block-layout-14f952f66964022f.js → block-layout-7f4b735c67115df5.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-e7d48e6b0c3068ac.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-b943f31f050fc3a4.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/overview-597b74828bf105db.js → frontend_dist/_next/static/chunks/pages/overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-7181b086c93784d2.js → [...slug]-7e737f6fc7e83e9b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-d94488e3f2eeef36.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-cc641a7fa8473796.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a5c0362763a21fa8.js → block-runs-284309877f3c5a5a.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-26250e5335194ade.js +1 -0
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-7acc7afc00df17c2.js → frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5f4c8128b2413fd8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-4ebfc8e400315dda.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-e5e0150a256aadb3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/account/{profile-3f0df3decc856ee9.js → profile-3ae43c932537b254.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js → frontend_dist/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js → frontend_dist/_next/static/chunks/pages/settings/platform/settings-319ddbabc239e91b.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-47b64ced27c24985.js → [...slug]-5c360f72e4498855.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{permissions-e5a4d3d815cec25d.js → permissions-fb29fa6c2bd90bb0.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-3b76fa959ffa09d3.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-379e1ee292504842.js → [...slug]-3b787b42f1093b1f.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-0b83fbdd39e85f5b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-a1e6950974d643a8.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/users/{[...slug]-2af9afbe727d88aa.js → [...slug]-0aa019d87db8b0b8.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/{users-a4db8710f703c729.js → users-88c694d19207f2ec.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-31d0d50f7f30462b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/{webpack-d079359c241db804.js → webpack-ac7fdc472bedf682.js} +1 -1
- mage_ai/server/frontend_dist/block-layout.html +3 -3
- mage_ai/server/frontend_dist/compute.html +6 -6
- mage_ai/server/frontend_dist/files.html +6 -6
- mage_ai/server/frontend_dist/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-data-products.html +6 -6
- mage_ai/server/frontend_dist/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/index.html +3 -3
- mage_ai/server/frontend_dist/manage/files.html +6 -6
- mage_ai/server/frontend_dist/manage/settings.html +6 -6
- mage_ai/server/frontend_dist/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist/manage/users.html +6 -6
- mage_ai/server/frontend_dist/manage.html +6 -6
- mage_ai/server/frontend_dist/oauth.html +5 -5
- mage_ai/server/frontend_dist/overview.html +6 -6
- mage_ai/server/frontend_dist/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist/pipelines.html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist/settings.html +3 -3
- mage_ai/server/frontend_dist/sign-in.html +12 -12
- mage_ai/server/frontend_dist/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist/templates.html +6 -6
- mage_ai/server/frontend_dist/terminal.html +6 -6
- mage_ai/server/frontend_dist/test.html +3 -3
- mage_ai/server/frontend_dist/triggers.html +6 -6
- mage_ai/server/frontend_dist/version-control.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/404.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1376-22de38b4ad008d8a.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{1557-b3502f3f1aa92ac7.js → 1557-25a7d985d5564fd3.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1668-30b4619b9534519b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1799-c42db95a015689ee.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2996-2108b53b9d371d8d.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/3763-61b542dafdbf5754.js → frontend_dist_base_path_template/_next/static/chunks/3763-40780c6d1e4b261d.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-129dd2a2448a2e36.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3958-bcdfa414ccfa1eb2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4168-97fd1578d1a38315.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4982-fa5a238b139fbdd2.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-176f445e1313f001.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7162-7dd03f0f605de721.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7779-68d2b72a90c5f925.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-5446a8e43711e2f9.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8023-6c2f172f48dcb99b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-c351b8a735d73e0c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{main-70b78159c2bb3fe1.js → main-384298e9133cec76.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-13a578bce3b7f30c.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{block-layout-14f952f66964022f.js → block-layout-7f4b735c67115df5.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-e7d48e6b0c3068ac.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-b943f31f050fc3a4.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/overview-597b74828bf105db.js → frontend_dist_base_path_template/_next/static/chunks/pages/overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/{[...slug]-7181b086c93784d2.js → [...slug]-7e737f6fc7e83e9b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-d94488e3f2eeef36.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-cc641a7fa8473796.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/{block-runs-a5c0362763a21fa8.js → block-runs-284309877f3c5a5a.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-26250e5335194ade.js +1 -0
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors-7acc7afc00df17c2.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors-5f4c8128b2413fd8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-4ebfc8e400315dda.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-e5e0150a256aadb3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/account/{profile-3f0df3decc856ee9.js → profile-3ae43c932537b254.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/preferences-32985f3f7c7dd3ab.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/settings/platform/settings-c2e9ef989c8bfa73.js → frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/settings-319ddbabc239e91b.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/permissions/{[...slug]-47b64ced27c24985.js → [...slug]-5c360f72e4498855.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{permissions-e5a4d3d815cec25d.js → permissions-fb29fa6c2bd90bb0.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-3b76fa959ffa09d3.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles/{[...slug]-379e1ee292504842.js → [...slug]-3b787b42f1093b1f.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-0b83fbdd39e85f5b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-a1e6950974d643a8.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/users/{[...slug]-2af9afbe727d88aa.js → [...slug]-0aa019d87db8b0b8.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/{users-a4db8710f703c729.js → users-88c694d19207f2ec.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-31d0d50f7f30462b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{webpack-68c003fb6a175cd7.js → webpack-481689d9989710cd.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/kcptwoOU-JJJg6Vwpkfmx/_buildManifest.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/block-layout.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/compute.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-data-products.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/index.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/manage/files.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/[user].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users/new.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/manage.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/oauth.html +5 -5
- mage_ai/server/frontend_dist_base_path_template/overview.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipeline-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/backfills.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/dashboard.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/edit.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/logs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors/block-runtime.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/monitors.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs/[run].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/runs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/syncs.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline]/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/pipelines/[pipeline].html +3 -3
- mage_ai/server/frontend_dist_base_path_template/pipelines.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/platform/global-hooks.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/account/profile.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/platform/settings.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/permissions.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/preferences.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/roles.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/sync-data.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings/workspace/users.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/settings.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/sign-in.html +12 -12
- mage_ai/server/frontend_dist_base_path_template/templates/[...slug].html +6 -6
- mage_ai/server/frontend_dist_base_path_template/templates.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/terminal.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/test.html +3 -3
- mage_ai/server/frontend_dist_base_path_template/triggers.html +6 -6
- mage_ai/server/frontend_dist_base_path_template/version-control.html +6 -6
- mage_ai/server/kernel_output_parser.py +4 -1
- mage_ai/server/scheduler_manager.py +9 -0
- mage_ai/server/server.py +35 -31
- mage_ai/server/utils/custom_output.py +284 -0
- mage_ai/server/utils/execute_custom_code.py +245 -0
- mage_ai/server/utils/output_display.py +123 -289
- mage_ai/server/websocket_server.py +116 -69
- mage_ai/services/k8s/config.py +23 -0
- mage_ai/services/k8s/job_manager.py +6 -1
- mage_ai/services/ssh/aws/emr/utils.py +8 -8
- mage_ai/settings/keys/auth.py +1 -0
- mage_ai/settings/platform/__init__.py +159 -38
- mage_ai/settings/platform/constants.py +5 -0
- mage_ai/settings/platform/utils.py +53 -10
- mage_ai/settings/repo.py +26 -12
- mage_ai/settings/server.py +128 -37
- mage_ai/shared/array.py +24 -1
- mage_ai/shared/complex.py +45 -0
- mage_ai/shared/config.py +2 -1
- mage_ai/shared/custom_logger.py +11 -0
- mage_ai/shared/dates.py +10 -6
- mage_ai/shared/files.py +63 -8
- mage_ai/shared/hash.py +33 -9
- mage_ai/shared/io.py +9 -5
- mage_ai/shared/models.py +82 -24
- mage_ai/shared/outputs.py +87 -0
- mage_ai/shared/parsers.py +141 -15
- mage_ai/shared/path_fixer.py +11 -7
- mage_ai/shared/singletons/__init__.py +0 -0
- mage_ai/shared/singletons/base.py +47 -0
- mage_ai/shared/singletons/memory.py +38 -0
- mage_ai/shared/strings.py +34 -1
- mage_ai/shared/yaml.py +24 -0
- mage_ai/streaming/sinks/oracledb.py +57 -0
- mage_ai/streaming/sinks/sink_factory.py +4 -0
- mage_ai/system/__init__.py +0 -0
- mage_ai/system/constants.py +14 -0
- mage_ai/system/memory/__init__.py +0 -0
- mage_ai/system/memory/constants.py +1 -0
- mage_ai/system/memory/manager.py +174 -0
- mage_ai/system/memory/presenters.py +158 -0
- mage_ai/system/memory/process.py +216 -0
- mage_ai/system/memory/samples.py +13 -0
- mage_ai/system/memory/utils.py +656 -0
- mage_ai/system/memory/wrappers.py +177 -0
- mage_ai/system/models.py +58 -0
- mage_ai/system/storage/__init__.py +0 -0
- mage_ai/system/storage/utils.py +29 -0
- mage_ai/tests/api/endpoints/mixins.py +2 -2
- mage_ai/tests/api/endpoints/test_blocks.py +2 -1
- mage_ai/tests/api/endpoints/test_custom_designs.py +4 -4
- mage_ai/tests/api/endpoints/test_pipeline_runs.py +2 -2
- mage_ai/tests/api/endpoints/test_projects.py +2 -1
- mage_ai/tests/api/operations/base/test_base.py +27 -27
- mage_ai/tests/api/operations/base/test_base_with_user_authentication.py +27 -27
- mage_ai/tests/api/operations/base/test_base_with_user_permissions.py +23 -23
- mage_ai/tests/api/operations/test_syncs.py +6 -4
- mage_ai/tests/api/resources/test_pipeline_resource.py +9 -2
- mage_ai/tests/authentication/providers/test_oidc.py +59 -0
- mage_ai/tests/base_test.py +2 -2
- mage_ai/tests/data/__init__.py +0 -0
- mage_ai/tests/data/models/__init__.py +0 -0
- mage_ai/tests/data_preparation/executors/test_block_executor.py +23 -16
- mage_ai/tests/data_preparation/git/test_git.py +4 -1
- mage_ai/tests/data_preparation/models/block/dynamic/test_combos.py +305 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_counter.py +212 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_factory.py +360 -0
- mage_ai/tests/data_preparation/models/block/dynamic/test_variables.py +332 -0
- mage_ai/tests/data_preparation/models/block/hook/test_hook_block.py +2 -2
- mage_ai/tests/data_preparation/models/block/platform/test_mixins.py +1 -1
- mage_ai/tests/data_preparation/models/block/sql/utils/test_shared.py +26 -1
- mage_ai/tests/data_preparation/models/block/test_global_data_product.py +3 -2
- mage_ai/tests/data_preparation/models/custom_templates/test_utils.py +5 -4
- mage_ai/tests/data_preparation/models/global_hooks/test_hook.py +3 -0
- mage_ai/tests/data_preparation/models/global_hooks/test_predicates.py +9 -3
- mage_ai/tests/data_preparation/models/test_block.py +115 -120
- mage_ai/tests/data_preparation/models/test_blocks_helper.py +114 -0
- mage_ai/tests/data_preparation/models/test_global_data_product.py +41 -24
- mage_ai/tests/data_preparation/models/test_pipeline.py +9 -6
- mage_ai/tests/data_preparation/models/test_project.py +4 -1
- mage_ai/tests/data_preparation/models/test_utils.py +80 -0
- mage_ai/tests/data_preparation/models/test_variable.py +242 -69
- mage_ai/tests/data_preparation/models/variables/__init__.py +0 -0
- mage_ai/tests/data_preparation/models/variables/test_summarizer.py +481 -0
- mage_ai/tests/data_preparation/storage/shared/__init__.py +0 -0
- mage_ai/tests/data_preparation/test_repo_manager.py +6 -7
- mage_ai/tests/data_preparation/test_variable_manager.py +57 -48
- mage_ai/tests/factory.py +64 -43
- mage_ai/tests/orchestration/db/models/test_schedules.py +3 -3
- mage_ai/tests/orchestration/db/models/test_schedules_dynamic_blocks.py +279 -0
- mage_ai/tests/orchestration/test_pipeline_scheduler.py +1 -0
- mage_ai/tests/orchestration/triggers/test_global_data_product.py +3 -2
- mage_ai/tests/orchestration/triggers/test_utils.py +3 -2
- mage_ai/tests/services/k8s/test_job_manager.py +18 -0
- mage_ai/tests/streaming/sinks/test_oracledb.py +38 -0
- mage_ai/tests/test_shared.py +61 -0
- mage_ai/usage_statistics/logger.py +7 -2
- mage_ai/utils/code.py +33 -19
- {mage_ai-0.9.70.dist-info → mage_ai-0.9.71.dist-info}/METADATA +5 -2
- {mage_ai-0.9.70.dist-info → mage_ai-0.9.71.dist-info}/RECORD +513 -417
- mage_ai/data_preparation/models/global_data_product/constants.py +0 -6
- mage_ai/server/frontend_dist/_next/static/RhDiJSkcjCsh4xxX4BFBk/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/2631-b9f9bea3f1cf906d.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/3782-ef4cd4f0b52072d0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/4783-422429203610c318.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/5699-6d708c6b2153ea08.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/635-0d6b7c8804bcd2dc.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7022-0d52dd8868621fb0.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7361-8a23dd8360593e7a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/7966-b9b85ba10667e654.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8095-bdce03896ef9639a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/8146-6bed4e7401e067e6.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9265-d2a1aaec75ec69b8.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9440-4069842b90d4b801.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/9832-67896490f6e8a014.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products/[...slug]-591abd392dc50ed4.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/global-data-products-78e8e88f2a757a18.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-95ffcd3e2b27e567.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-1ed9045b2f1dfd65.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/roles-36fa165a48af586b.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/TdpLLFome13qvM0gXvpHs/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/2631-b9f9bea3f1cf906d.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/3782-ef4cd4f0b52072d0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/4783-422429203610c318.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/5699-6d708c6b2153ea08.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/635-0d6b7c8804bcd2dc.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7022-0d52dd8868621fb0.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7361-8a23dd8360593e7a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/7966-b9b85ba10667e654.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8095-bdce03896ef9639a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/8146-6bed4e7401e067e6.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9265-d2a1aaec75ec69b8.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9440-4069842b90d4b801.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/9832-67896490f6e8a014.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/_app-2a69553d8c6eeb53.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products/[...slug]-591abd392dc50ed4.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/global-data-products-78e8e88f2a757a18.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/dashboard-95ffcd3e2b27e567.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/edit-b645a6d13ab9fe3a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/monitors/block-runtime-1ed9045b2f1dfd65.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/runs/[run]-1417ad1c821d720a.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/settings-59aca25a5b1d3998.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-349af617d05f001b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/roles-36fa165a48af586b.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/sync-data-60d01d3887e31136.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-3433c8b22e8342aa.js +0 -1
- mage_ai/shared/memory.py +0 -90
- mage_ai/tests/data_preparation/models/block/dynamic/test_dynamic_helpers.py +0 -48
- /mage_ai/{tests/data_preparation/shared → ai/utils}/__init__.py +0 -0
- /mage_ai/server/frontend_dist/_next/static/{RhDiJSkcjCsh4xxX4BFBk → UZLabyPgcxtZvp0O0EUUS}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{TdpLLFome13qvM0gXvpHs → kcptwoOU-JJJg6Vwpkfmx}/_ssgManifest.js +0 -0
- /mage_ai/tests/data_preparation/{shared → storage/shared}/test_secrets.py +0 -0
- {mage_ai-0.9.70.dist-info → mage_ai-0.9.71.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.70.dist-info → mage_ai-0.9.71.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.70.dist-info → mage_ai-0.9.71.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.70.dist-info → mage_ai-0.9.71.dist-info}/top_level.txt +0 -0
|
@@ -12,13 +12,14 @@ from mage_ai.settings.platform.constants import ( # noqa: F401
|
|
|
12
12
|
platform_settings_full_path,
|
|
13
13
|
project_platform_activated,
|
|
14
14
|
)
|
|
15
|
+
from mage_ai.settings.server import ENABLE_USER_PROJECTS
|
|
15
16
|
from mage_ai.settings.utils import base_repo_name, base_repo_path
|
|
16
17
|
from mage_ai.shared.array import find
|
|
17
18
|
from mage_ai.shared.hash import combine_into, dig, extract, merge_dict
|
|
18
19
|
from mage_ai.shared.io import safe_write
|
|
19
20
|
|
|
20
21
|
|
|
21
|
-
def activate_project(project_name: str) -> None:
|
|
22
|
+
def activate_project(project_name: str, user=None) -> None:
|
|
22
23
|
"""
|
|
23
24
|
Activate a specified project and update local platform settings accordingly.
|
|
24
25
|
|
|
@@ -37,33 +38,48 @@ def activate_project(project_name: str) -> None:
|
|
|
37
38
|
added to the 'projects' dictionary with the 'active' attribute set to True.
|
|
38
39
|
"""
|
|
39
40
|
if project_name:
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if user and ENABLE_USER_PROJECTS:
|
|
42
|
+
from mage_ai.data_preparation.repo_manager import get_project_uuid
|
|
43
|
+
from mage_ai.orchestration.db.models.utils import activate_project_for_user
|
|
44
|
+
activate_project_for_user(user, get_project_uuid(), project_name)
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
platform_settings
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
else:
|
|
47
|
+
platform_settings = __local_platform_settings() or {}
|
|
48
|
+
if 'projects' not in platform_settings:
|
|
49
|
+
platform_settings['projects'] = {}
|
|
48
50
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
continue
|
|
53
|
-
platform_settings['projects'][key] = merge_dict(
|
|
54
|
-
platform_settings['projects'].get(key) or {},
|
|
55
|
-
dict(active=False),
|
|
51
|
+
platform_settings['projects'][project_name] = merge_dict(
|
|
52
|
+
platform_settings['projects'].get(project_name) or {},
|
|
53
|
+
dict(active=True),
|
|
56
54
|
)
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
projects = platform_settings['projects'] or {}
|
|
57
|
+
for key in projects.keys():
|
|
58
|
+
if key == project_name:
|
|
59
|
+
continue
|
|
60
|
+
platform_settings['projects'][key] = merge_dict(
|
|
61
|
+
platform_settings['projects'].get(key) or {},
|
|
62
|
+
dict(active=False),
|
|
63
|
+
)
|
|
59
64
|
|
|
65
|
+
__update_local_platform_settings(platform_settings)
|
|
60
66
|
|
|
67
|
+
|
|
68
|
+
# default repo_path will be the root project repo path if not provided downstream
|
|
61
69
|
def build_repo_path_for_all_projects(
|
|
62
70
|
repo_path: str = None,
|
|
71
|
+
context_data: Dict = None,
|
|
63
72
|
mage_projects_only: bool = False
|
|
64
73
|
) -> Dict:
|
|
74
|
+
# from mage_ai.shared.custom_logger import DX_PRINTER
|
|
75
|
+
# DX_PRINTER.info('build repo path for all projects')
|
|
76
|
+
# DX_PRINTER.print_call_stack()
|
|
65
77
|
mapping = {}
|
|
66
|
-
settings = project_platform_settings(
|
|
78
|
+
settings = project_platform_settings(
|
|
79
|
+
repo_path=repo_path,
|
|
80
|
+
context_data=context_data,
|
|
81
|
+
mage_projects_only=mage_projects_only,
|
|
82
|
+
)
|
|
67
83
|
root_project_path = base_repo_path()
|
|
68
84
|
root_project_name = base_repo_name()
|
|
69
85
|
|
|
@@ -84,15 +100,24 @@ def build_repo_path_for_all_projects(
|
|
|
84
100
|
def repo_path_from_database_query_to_project_repo_path(
|
|
85
101
|
key: str,
|
|
86
102
|
repo_path: str = None,
|
|
103
|
+
context_data: Dict = None,
|
|
87
104
|
) -> Dict:
|
|
88
105
|
mapping = {}
|
|
89
106
|
|
|
90
|
-
repo_paths = build_repo_path_for_all_projects(
|
|
107
|
+
repo_paths = build_repo_path_for_all_projects(
|
|
108
|
+
repo_path=repo_path,
|
|
109
|
+
context_data=context_data,
|
|
110
|
+
mage_projects_only=True,
|
|
111
|
+
)
|
|
91
112
|
for paths in repo_paths.values():
|
|
92
113
|
full_path = paths['full_path']
|
|
93
114
|
mapping[full_path] = full_path
|
|
94
115
|
|
|
95
|
-
settings = project_platform_settings(
|
|
116
|
+
settings = project_platform_settings(
|
|
117
|
+
repo_path=repo_path,
|
|
118
|
+
context_data=context_data,
|
|
119
|
+
mage_projects_only=True,
|
|
120
|
+
)
|
|
96
121
|
for project_name, setting in settings.items():
|
|
97
122
|
query_arr_paths = []
|
|
98
123
|
query_arr = dig(setting, ['database', 'query', key])
|
|
@@ -114,6 +139,7 @@ def repo_path_from_database_query_to_project_repo_path(
|
|
|
114
139
|
def get_repo_paths_for_file_path(
|
|
115
140
|
file_path: str,
|
|
116
141
|
repo_path: str = None,
|
|
142
|
+
repo_paths_all: Dict = None,
|
|
117
143
|
mage_projects_only: bool = False,
|
|
118
144
|
) -> Dict:
|
|
119
145
|
if not file_path:
|
|
@@ -121,10 +147,11 @@ def get_repo_paths_for_file_path(
|
|
|
121
147
|
|
|
122
148
|
result = None
|
|
123
149
|
|
|
124
|
-
repo_paths_all
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
150
|
+
if repo_paths_all is None:
|
|
151
|
+
repo_paths_all = build_repo_path_for_all_projects(
|
|
152
|
+
repo_path=repo_path,
|
|
153
|
+
mage_projects_only=mage_projects_only,
|
|
154
|
+
)
|
|
128
155
|
|
|
129
156
|
matches = []
|
|
130
157
|
|
|
@@ -185,12 +212,28 @@ def get_repo_paths_for_file_path(
|
|
|
185
212
|
return result
|
|
186
213
|
|
|
187
214
|
|
|
188
|
-
def build_active_project_repo_path(
|
|
215
|
+
def build_active_project_repo_path(
|
|
216
|
+
context_data: Dict = None,
|
|
217
|
+
repo_path: str = None,
|
|
218
|
+
user=None,
|
|
219
|
+
) -> str:
|
|
189
220
|
if not repo_path:
|
|
190
221
|
repo_path = base_repo_path()
|
|
191
222
|
|
|
192
|
-
|
|
193
|
-
|
|
223
|
+
if context_data is None:
|
|
224
|
+
context_data = dict()
|
|
225
|
+
|
|
226
|
+
settings = project_platform_settings(
|
|
227
|
+
context_data=context_data,
|
|
228
|
+
repo_path=repo_path,
|
|
229
|
+
mage_projects_only=True,
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
active_project = active_project_settings(
|
|
233
|
+
context_data=context_data,
|
|
234
|
+
settings=settings,
|
|
235
|
+
user=user,
|
|
236
|
+
)
|
|
194
237
|
no_active_project = not active_project
|
|
195
238
|
|
|
196
239
|
items = list(settings.items() or [])
|
|
@@ -231,9 +274,11 @@ def platform_settings(mage_projects_only: bool = False) -> Dict:
|
|
|
231
274
|
|
|
232
275
|
|
|
233
276
|
def active_project_settings(
|
|
277
|
+
context_data: Dict = None,
|
|
234
278
|
get_default: bool = False,
|
|
235
279
|
repo_path: str = None,
|
|
236
280
|
settings: Dict = None,
|
|
281
|
+
user=None,
|
|
237
282
|
) -> Dict:
|
|
238
283
|
"""
|
|
239
284
|
Retrieve the settings of the active project or the default project.
|
|
@@ -245,6 +290,8 @@ def active_project_settings(
|
|
|
245
290
|
are fetched for the specific repository.
|
|
246
291
|
settings (Dict, optional): Pre-existing project platform settings. If not provided,
|
|
247
292
|
settings are fetched using project_platform_settings.
|
|
293
|
+
user (User, optional): When provided, we will fetch the settings for the active project
|
|
294
|
+
for the user. The active project can be different depending on the user.
|
|
248
295
|
|
|
249
296
|
Returns:
|
|
250
297
|
Dict: A dictionary containing the settings of the active or default project.
|
|
@@ -262,17 +309,48 @@ def active_project_settings(
|
|
|
262
309
|
>>> active_project_settings(get_default=True, repo_path='/path/to/repo')
|
|
263
310
|
{'uuid': 'default_project_uuid', 'active': 'true', 'path': 'relative/path'}
|
|
264
311
|
"""
|
|
312
|
+
from mage_ai.data_preparation.repo_manager import get_project_uuid
|
|
313
|
+
|
|
314
|
+
if context_data is None:
|
|
315
|
+
context_data = dict()
|
|
316
|
+
|
|
317
|
+
if context_data.get('active_project_settings'):
|
|
318
|
+
return context_data['active_project_settings']
|
|
319
|
+
|
|
320
|
+
# from mage_ai.shared.custom_logger import DX_PRINTER
|
|
321
|
+
# DX_PRINTER.info(f'active project settings {id(context_data)} context '
|
|
322
|
+
# f'{context_data} user {user}')
|
|
323
|
+
# DX_PRINTER.print_call_stack()
|
|
324
|
+
|
|
265
325
|
if not settings:
|
|
266
|
-
settings = project_platform_settings(
|
|
326
|
+
settings = project_platform_settings(
|
|
327
|
+
context_data=context_data,
|
|
328
|
+
repo_path=repo_path,
|
|
329
|
+
mage_projects_only=True,
|
|
330
|
+
)
|
|
331
|
+
|
|
332
|
+
# print(f'active project settings {settings}')
|
|
267
333
|
|
|
268
334
|
items = list(settings.items())
|
|
269
335
|
if not items:
|
|
270
336
|
return
|
|
271
337
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
338
|
+
user_active_project = None
|
|
339
|
+
if user and ENABLE_USER_PROJECTS:
|
|
340
|
+
from mage_ai.orchestration.db.models.utils import get_active_project_for_user
|
|
341
|
+
|
|
342
|
+
user_active_project = get_active_project_for_user(user, get_project_uuid())
|
|
343
|
+
if user_active_project:
|
|
344
|
+
key = user_active_project.project_name
|
|
345
|
+
project_settings_tup = find(
|
|
346
|
+
lambda tup: tup and tup[0] == key,
|
|
347
|
+
items,
|
|
348
|
+
)
|
|
349
|
+
else:
|
|
350
|
+
project_settings_tup = find(
|
|
351
|
+
lambda tup: tup and len(tup) >= 2 and (tup[1] or {}).get('active'),
|
|
352
|
+
items,
|
|
353
|
+
)
|
|
276
354
|
|
|
277
355
|
if not project_settings_tup and get_default:
|
|
278
356
|
# Get the first item in the settings by default
|
|
@@ -281,13 +359,30 @@ def active_project_settings(
|
|
|
281
359
|
if project_settings_tup:
|
|
282
360
|
project_name, project_settings = project_settings_tup
|
|
283
361
|
|
|
284
|
-
|
|
362
|
+
active_project_settings = merge_dict(
|
|
285
363
|
project_settings or {},
|
|
286
364
|
dict(uuid=project_name),
|
|
287
365
|
)
|
|
366
|
+
context_data['active_project_settings'] = active_project_settings
|
|
367
|
+
return active_project_settings
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
def project_platform_settings(
|
|
371
|
+
repo_path: str = None,
|
|
372
|
+
context_data: Dict = None,
|
|
373
|
+
mage_projects_only: bool = False,
|
|
374
|
+
user=None,
|
|
375
|
+
) -> Dict:
|
|
376
|
+
if context_data is None:
|
|
377
|
+
context_data = dict()
|
|
288
378
|
|
|
379
|
+
settings = context_data.get('platform_settings')
|
|
380
|
+
if settings:
|
|
381
|
+
return settings
|
|
289
382
|
|
|
290
|
-
|
|
383
|
+
# from mage_ai.shared.custom_logger import DX_PRINTER
|
|
384
|
+
# DX_PRINTER.info(f'project_platform_settings {repo_path} {id(context_data)} {context_data}')
|
|
385
|
+
# DX_PRINTER.print_call_stack()
|
|
291
386
|
mapping = (__combined_platform_settings(
|
|
292
387
|
repo_path=repo_path,
|
|
293
388
|
mage_projects_only=mage_projects_only,
|
|
@@ -299,9 +394,9 @@ def project_platform_settings(repo_path: str = None, mage_projects_only: bool =
|
|
|
299
394
|
for project_name, settings in mapping.items():
|
|
300
395
|
if 'is_project' not in settings or settings.get('is_project'):
|
|
301
396
|
select_keys.append(project_name)
|
|
397
|
+
mapping = extract(mapping, select_keys)
|
|
302
398
|
|
|
303
|
-
|
|
304
|
-
|
|
399
|
+
context_data['platform_settings'] = mapping
|
|
305
400
|
return mapping
|
|
306
401
|
|
|
307
402
|
|
|
@@ -331,10 +426,19 @@ def __combined_platform_settings(repo_path: str = None, mage_projects_only: bool
|
|
|
331
426
|
return parent
|
|
332
427
|
|
|
333
428
|
|
|
334
|
-
def git_settings(
|
|
429
|
+
def git_settings(
|
|
430
|
+
repo_path: str = None,
|
|
431
|
+
context_data: Dict = None,
|
|
432
|
+
user=None,
|
|
433
|
+
) -> Dict:
|
|
335
434
|
git_dict = {}
|
|
336
435
|
|
|
337
|
-
settings = active_project_settings(
|
|
436
|
+
settings = active_project_settings(
|
|
437
|
+
context_data=context_data,
|
|
438
|
+
get_default=True,
|
|
439
|
+
repo_path=repo_path,
|
|
440
|
+
user=user,
|
|
441
|
+
)
|
|
338
442
|
if settings and settings.get('git'):
|
|
339
443
|
git_dict = settings.get('git') or {}
|
|
340
444
|
|
|
@@ -344,12 +448,29 @@ def git_settings(repo_path: str = None) -> Dict:
|
|
|
344
448
|
git_dict['path'],
|
|
345
449
|
)
|
|
346
450
|
else:
|
|
347
|
-
git_dict['path'] = build_active_project_repo_path(
|
|
451
|
+
git_dict['path'] = build_active_project_repo_path(
|
|
452
|
+
context_data=context_data,
|
|
453
|
+
repo_path=repo_path,
|
|
454
|
+
user=user,
|
|
455
|
+
)
|
|
348
456
|
|
|
349
457
|
return git_dict
|
|
350
458
|
|
|
351
459
|
|
|
352
460
|
def __get_projects_of_any_type() -> Dict:
|
|
461
|
+
"""
|
|
462
|
+
Retrieves projects of any type from the repository directory.
|
|
463
|
+
|
|
464
|
+
Returns:
|
|
465
|
+
Dict: A dictionary containing project information with the following structure:
|
|
466
|
+
{
|
|
467
|
+
'project_name': {
|
|
468
|
+
'is_project': bool, # Indicates if it's a project based on metadata presence
|
|
469
|
+
'is_project_platform': bool, # If it's a project platform based on settings.yaml
|
|
470
|
+
'uuid': str # Unique identifier of the project
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
"""
|
|
353
474
|
mapping = {}
|
|
354
475
|
|
|
355
476
|
repo_path = base_repo_path()
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
+
from mage_ai.settings import REQUIRE_USER_AUTHENTICATION
|
|
3
4
|
from mage_ai.settings.utils import base_repo_path
|
|
4
5
|
|
|
5
6
|
PLATFORM_SETTINGS_FILENAME = 'settings.yaml'
|
|
@@ -22,3 +23,7 @@ set_project_platform_activated_flag()
|
|
|
22
23
|
|
|
23
24
|
def project_platform_activated() -> bool:
|
|
24
25
|
return project_platform_activated_flag
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def user_project_platform_activated() -> bool:
|
|
29
|
+
return project_platform_activated_flag and REQUIRE_USER_AUTHENTICATION
|
|
@@ -22,9 +22,13 @@ def get_pipeline_from_platform(
|
|
|
22
22
|
use_repo_path: bool = False,
|
|
23
23
|
):
|
|
24
24
|
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
25
|
+
from mage_ai.settings.repo import get_repo_path
|
|
25
26
|
|
|
26
27
|
if not project_platform_activated():
|
|
27
|
-
|
|
28
|
+
repo_path = repo_path or get_repo_path()
|
|
29
|
+
return Pipeline.get(
|
|
30
|
+
pipeline_uuid, check_if_exists=check_if_exists, repo_path=repo_path
|
|
31
|
+
)
|
|
28
32
|
|
|
29
33
|
if not mapping:
|
|
30
34
|
mapping = repo_path_from_database_query_to_project_repo_path('pipeline_schedules')
|
|
@@ -36,8 +40,8 @@ def get_pipeline_from_platform(
|
|
|
36
40
|
|
|
37
41
|
return Pipeline.get(
|
|
38
42
|
pipeline_uuid,
|
|
39
|
-
repo_path=repo_path,
|
|
40
43
|
all_projects=False if repo_path else True,
|
|
44
|
+
repo_path=repo_path,
|
|
41
45
|
use_repo_path=use_repo_path,
|
|
42
46
|
)
|
|
43
47
|
|
|
@@ -45,16 +49,21 @@ def get_pipeline_from_platform(
|
|
|
45
49
|
async def get_pipeline_from_platform_async(
|
|
46
50
|
pipeline_uuid: str,
|
|
47
51
|
repo_path: str = None,
|
|
52
|
+
context_data: Dict = None,
|
|
48
53
|
mapping: Dict = None,
|
|
49
54
|
use_repo_path: bool = False,
|
|
50
55
|
):
|
|
51
56
|
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
52
57
|
|
|
53
58
|
if not project_platform_activated():
|
|
54
|
-
return await Pipeline.get_async(pipeline_uuid)
|
|
59
|
+
return await Pipeline.get_async(pipeline_uuid, repo_path=repo_path)
|
|
55
60
|
|
|
56
61
|
if not mapping:
|
|
57
|
-
mapping = repo_path_from_database_query_to_project_repo_path(
|
|
62
|
+
mapping = repo_path_from_database_query_to_project_repo_path(
|
|
63
|
+
'pipeline_schedules',
|
|
64
|
+
repo_path=repo_path,
|
|
65
|
+
context_data=context_data,
|
|
66
|
+
)
|
|
58
67
|
|
|
59
68
|
if repo_path and not use_repo_path:
|
|
60
69
|
repo_path = mapping.get(repo_path)
|
|
@@ -63,22 +72,47 @@ async def get_pipeline_from_platform_async(
|
|
|
63
72
|
|
|
64
73
|
return await Pipeline.get_async(
|
|
65
74
|
pipeline_uuid,
|
|
66
|
-
repo_path=repo_path,
|
|
67
75
|
all_projects=False if repo_path else True,
|
|
76
|
+
repo_path=repo_path,
|
|
68
77
|
use_repo_path=use_repo_path,
|
|
69
78
|
)
|
|
70
79
|
|
|
71
80
|
|
|
72
|
-
def get_pipeline_config_path(
|
|
81
|
+
def get_pipeline_config_path(
|
|
82
|
+
pipeline_uuid: str,
|
|
83
|
+
context_data: Dict = None,
|
|
84
|
+
repo_path: str = None,
|
|
85
|
+
) -> Tuple[str, str]:
|
|
73
86
|
from mage_ai.settings.repo import get_repo_path
|
|
74
87
|
|
|
75
|
-
|
|
88
|
+
if context_data is None:
|
|
89
|
+
context_data = dict()
|
|
90
|
+
|
|
91
|
+
if not repo_path:
|
|
92
|
+
repo_path_active = get_repo_path(
|
|
93
|
+
context_data=context_data,
|
|
94
|
+
root_project=False,
|
|
95
|
+
)
|
|
96
|
+
else:
|
|
97
|
+
repo_path_active = repo_path
|
|
76
98
|
|
|
77
99
|
path_relative = os.path.join(PIPELINES_FOLDER, pipeline_uuid, PIPELINE_CONFIG_FILE)
|
|
78
100
|
|
|
101
|
+
if not context_data.get('repo_paths_all'):
|
|
102
|
+
repo_paths_all = build_repo_path_for_all_projects(
|
|
103
|
+
context_data=context_data,
|
|
104
|
+
mage_projects_only=True,
|
|
105
|
+
)
|
|
106
|
+
context_data['repo_paths_all'] = repo_paths_all
|
|
107
|
+
else:
|
|
108
|
+
repo_paths_all = context_data['repo_paths_all']
|
|
109
|
+
|
|
79
110
|
full_paths = [
|
|
80
111
|
repo_path_active,
|
|
81
|
-
] + [fp for fp in full_paths_for_all_projects(
|
|
112
|
+
] + [fp for fp in full_paths_for_all_projects(
|
|
113
|
+
context_data=context_data,
|
|
114
|
+
repo_paths_all=repo_paths_all)
|
|
115
|
+
if fp != repo_path_active]
|
|
82
116
|
|
|
83
117
|
match_config_path = None
|
|
84
118
|
match_repo_path = None
|
|
@@ -94,6 +128,7 @@ def get_pipeline_config_path(pipeline_uuid: str) -> Tuple[str, str]:
|
|
|
94
128
|
paths = get_repo_paths_for_file_path(
|
|
95
129
|
file_path=full_filename,
|
|
96
130
|
mage_projects_only=True,
|
|
131
|
+
repo_paths_all=repo_paths_all,
|
|
97
132
|
)
|
|
98
133
|
match_config_path = full_filename
|
|
99
134
|
match_repo_path = (paths.get('full_path') if paths else None) or full_path
|
|
@@ -104,7 +139,15 @@ def get_pipeline_config_path(pipeline_uuid: str) -> Tuple[str, str]:
|
|
|
104
139
|
return match_config_path, match_repo_path
|
|
105
140
|
|
|
106
141
|
|
|
107
|
-
def full_paths_for_all_projects(
|
|
142
|
+
def full_paths_for_all_projects(
|
|
143
|
+
context_data: Dict = None,
|
|
144
|
+
repo_paths_all: Dict = None,
|
|
145
|
+
) -> List[str]:
|
|
146
|
+
if not repo_paths_all:
|
|
147
|
+
repo_paths_all = build_repo_path_for_all_projects(
|
|
148
|
+
context_data=context_data,
|
|
149
|
+
mage_projects_only=True,
|
|
150
|
+
)
|
|
108
151
|
return [d.get(
|
|
109
152
|
'full_path',
|
|
110
|
-
) for d in
|
|
153
|
+
) for d in repo_paths_all.values()]
|
mage_ai/settings/repo.py
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import Dict
|
|
4
|
+
from typing import Dict, Optional
|
|
5
5
|
|
|
6
|
-
import yaml
|
|
7
6
|
from jinja2 import Template
|
|
8
7
|
|
|
9
8
|
from mage_ai.settings.constants import PROJECT_METADATA_FILENAME, REPO_PATH_ENV_VAR
|
|
@@ -11,6 +10,7 @@ from mage_ai.settings.platform.constants import set_project_platform_activated_f
|
|
|
11
10
|
from mage_ai.settings.platform.utils import project_platform_activated
|
|
12
11
|
from mage_ai.settings.utils import base_repo_dirname, base_repo_path
|
|
13
12
|
from mage_ai.shared.environments import is_test
|
|
13
|
+
from mage_ai.shared.yaml import load_yaml
|
|
14
14
|
|
|
15
15
|
MAGE_PROJECT_TYPE_ENV_VAR = 'PROJECT_TYPE'
|
|
16
16
|
MAGE_CLUSTER_TYPE_ENV_VAR = 'CLUSTER_TYPE'
|
|
@@ -32,9 +32,11 @@ def base_repo_path_directory_name() -> str:
|
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
def get_repo_path(
|
|
35
|
+
context_data: Dict = None,
|
|
35
36
|
file_path: str = None,
|
|
36
37
|
root_project: bool = False,
|
|
37
38
|
absolute_path: bool = True,
|
|
39
|
+
user=None,
|
|
38
40
|
) -> str:
|
|
39
41
|
"""
|
|
40
42
|
Retrieve the repository path based on the given parameters.
|
|
@@ -44,6 +46,8 @@ def get_repo_path(
|
|
|
44
46
|
root_project (bool, optional): If True, returns the root project's repository path.
|
|
45
47
|
absolute_path (bool, optional): If True, returns the absolute repository path;
|
|
46
48
|
if False, returns the path relative to the base repository directory.
|
|
49
|
+
user (str, optional): The user to use to get the active project. This only applies
|
|
50
|
+
if multi project is enabled and root_project = False.
|
|
47
51
|
|
|
48
52
|
Returns:
|
|
49
53
|
str: The repository path as per the specified parameters.
|
|
@@ -88,7 +92,11 @@ def get_repo_path(
|
|
|
88
92
|
repo_path_use = settings.get('full_path')
|
|
89
93
|
|
|
90
94
|
if not repo_path_use:
|
|
91
|
-
repo_path_use = build_active_project_repo_path(
|
|
95
|
+
repo_path_use = build_active_project_repo_path(
|
|
96
|
+
context_data=context_data,
|
|
97
|
+
repo_path=repo_path,
|
|
98
|
+
user=user,
|
|
99
|
+
)
|
|
92
100
|
|
|
93
101
|
if repo_path_use:
|
|
94
102
|
repo_path = repo_path_use
|
|
@@ -142,13 +150,18 @@ def get_data_dir() -> str:
|
|
|
142
150
|
return os.getenv(MAGE_DATA_DIR_ENV_VAR) or DEFAULT_MAGE_DATA_DIR
|
|
143
151
|
|
|
144
152
|
|
|
145
|
-
def get_metadata_path(
|
|
146
|
-
|
|
153
|
+
def get_metadata_path(
|
|
154
|
+
repo_path: str = None,
|
|
155
|
+
root_project: bool = False
|
|
156
|
+
):
|
|
157
|
+
if repo_path is None:
|
|
158
|
+
repo_path = get_repo_path(root_project=root_project)
|
|
159
|
+
return os.path.join(repo_path, PROJECT_METADATA_FILENAME)
|
|
147
160
|
|
|
148
161
|
|
|
149
162
|
def get_variables_dir(
|
|
150
|
-
repo_path: str = None,
|
|
151
|
-
repo_config: Dict = None,
|
|
163
|
+
repo_path: Optional[str] = None,
|
|
164
|
+
repo_config: Optional[Dict] = None,
|
|
152
165
|
root_project: bool = False,
|
|
153
166
|
) -> str:
|
|
154
167
|
"""
|
|
@@ -181,16 +194,17 @@ def get_variables_dir(
|
|
|
181
194
|
else:
|
|
182
195
|
from mage_ai.data_preparation.shared.utils import get_template_vars_no_db
|
|
183
196
|
|
|
184
|
-
metadata_path = get_metadata_path(
|
|
197
|
+
metadata_path = get_metadata_path(
|
|
198
|
+
repo_path=repo_path,
|
|
199
|
+
root_project=root_project,
|
|
200
|
+
)
|
|
185
201
|
if os.path.exists(metadata_path):
|
|
186
202
|
with open(metadata_path, 'r', encoding='utf-8') as f:
|
|
187
203
|
config_file_raw = f.read()
|
|
188
|
-
repo_config =
|
|
204
|
+
repo_config = load_yaml(config_file_raw) or {}
|
|
189
205
|
if repo_config.get('variables_dir'):
|
|
190
206
|
variables_dir = repo_config.get('variables_dir')
|
|
191
|
-
variables_dir = Template(variables_dir).render(
|
|
192
|
-
**get_template_vars_no_db()
|
|
193
|
-
)
|
|
207
|
+
variables_dir = Template(variables_dir).render(**get_template_vars_no_db())
|
|
194
208
|
if variables_dir is None:
|
|
195
209
|
variables_dir = DEFAULT_MAGE_DATA_DIR
|
|
196
210
|
variables_dir = os.path.expanduser(variables_dir)
|