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
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import json
|
|
4
|
+
import os
|
|
2
5
|
import re
|
|
3
|
-
from typing import Dict, List
|
|
6
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
4
7
|
|
|
5
8
|
from mage_ai.data_preparation.models.block.dynamic.utils import (
|
|
6
9
|
has_reduce_output_from_upstreams,
|
|
@@ -51,7 +54,6 @@ def find_index_of_last_expression_lines(code_lines: List[str]) -> int:
|
|
|
51
54
|
or paranthesis_close > paranthesis_open
|
|
52
55
|
or square_brackets_close > square_brackets_open
|
|
53
56
|
):
|
|
54
|
-
|
|
55
57
|
starting_index -= 1
|
|
56
58
|
|
|
57
59
|
brackets_close += code_lines[starting_index].count('}')
|
|
@@ -84,12 +86,16 @@ def get_content_inside_triple_quotes(parts):
|
|
|
84
86
|
if re.search(r'[\w]+[ ]*=[ ]*[f]*"""', first_line):
|
|
85
87
|
variable = first_line.split('=')[0].strip()
|
|
86
88
|
|
|
87
|
-
return '\n'.join(
|
|
89
|
+
return '\n'.join(
|
|
90
|
+
parts[start_index + 1 : -1],
|
|
91
|
+
).replace('"', '\\"'), variable # ruff: ignore=E203
|
|
88
92
|
|
|
89
93
|
return None, None
|
|
90
94
|
|
|
91
95
|
|
|
92
|
-
def add_internal_output_info(
|
|
96
|
+
def add_internal_output_info(
|
|
97
|
+
block, code: str, extension_uuid: Optional[str] = None, widget: bool = False
|
|
98
|
+
) -> str:
|
|
93
99
|
if code.startswith('%%sql') or code.startswith('%%bash') or len(code) == 0:
|
|
94
100
|
return code
|
|
95
101
|
code_lines = remove_comments(code.split('\n'))
|
|
@@ -139,147 +145,37 @@ def add_internal_output_info(block, code: str) -> str:
|
|
|
139
145
|
is_dynamic = is_dynamic_block(block) if block else False
|
|
140
146
|
is_dynamic_child = is_dynamic_block_child(block) if block else False
|
|
141
147
|
|
|
148
|
+
pipeline_uuid = block.pipeline.uuid if block.pipeline else None
|
|
149
|
+
repo_path = block.pipeline.repo_path if block.pipeline else None
|
|
150
|
+
block_uuid = block.uuid
|
|
151
|
+
|
|
152
|
+
replacements = [
|
|
153
|
+
('DATAFRAME_ANALYSIS_MAX_COLUMNS', DATAFRAME_ANALYSIS_MAX_COLUMNS),
|
|
154
|
+
('DATAFRAME_SAMPLE_COUNT_PREVIEW', DATAFRAME_SAMPLE_COUNT_PREVIEW),
|
|
155
|
+
('block_uuid', f"'{block_uuid}'"),
|
|
156
|
+
('has_reduce_output', has_reduce_output),
|
|
157
|
+
('is_dynamic', is_dynamic),
|
|
158
|
+
('is_dynamic_child', is_dynamic_child),
|
|
159
|
+
('is_print_statement', is_print_statement),
|
|
160
|
+
('last_line', last_line),
|
|
161
|
+
('pipeline_uuid', f"'{pipeline_uuid}'"),
|
|
162
|
+
('repo_path', f"'{repo_path}'"),
|
|
163
|
+
('widget', widget),
|
|
164
|
+
]
|
|
165
|
+
replacements.append((
|
|
166
|
+
'extension_uuid',
|
|
167
|
+
f"'{extension_uuid}'" if extension_uuid else 'None',
|
|
168
|
+
))
|
|
169
|
+
|
|
170
|
+
custom_output_function_code = __interpolate_code_content(
|
|
171
|
+
'custom_output.py',
|
|
172
|
+
replacements,
|
|
173
|
+
)
|
|
174
|
+
|
|
142
175
|
internal_output = f"""
|
|
143
176
|
# Post processing code below (source: output_display.py)
|
|
144
177
|
|
|
145
|
-
|
|
146
|
-
def __custom_output():
|
|
147
|
-
import json
|
|
148
|
-
import warnings
|
|
149
|
-
from datetime import datetime
|
|
150
|
-
|
|
151
|
-
import pandas as pd
|
|
152
|
-
import polars as pl
|
|
153
|
-
import simplejson
|
|
154
|
-
|
|
155
|
-
from mage_ai.data_preparation.models.block.dynamic.utils import transform_output_for_display
|
|
156
|
-
from mage_ai.data_preparation.models.block.dynamic.utils import (
|
|
157
|
-
combine_transformed_output_for_multi_output,
|
|
158
|
-
transform_output_for_display_dynamic_child,
|
|
159
|
-
transform_output_for_display_reduce_output,
|
|
160
|
-
)
|
|
161
|
-
from mage_ai.shared.environments import is_debug
|
|
162
|
-
from mage_ai.shared.parsers import encode_complex, sample_output
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if pd.__version__ < '1.5.0':
|
|
166
|
-
from pandas.core.common import SettingWithCopyWarning
|
|
167
|
-
else:
|
|
168
|
-
from pandas.errors import SettingWithCopyWarning
|
|
169
|
-
|
|
170
|
-
warnings.simplefilter(action='ignore', category=SettingWithCopyWarning)
|
|
171
|
-
|
|
172
|
-
_internal_output_return = {last_line}
|
|
173
|
-
|
|
174
|
-
# Dynamic block child logic always takes precedence over dynamic block logic
|
|
175
|
-
if bool({is_dynamic_child}):
|
|
176
|
-
output_transformed = []
|
|
177
|
-
|
|
178
|
-
if _internal_output_return and isinstance(_internal_output_return, list):
|
|
179
|
-
for output in _internal_output_return:
|
|
180
|
-
output_tf = transform_output_for_display_dynamic_child(
|
|
181
|
-
output,
|
|
182
|
-
is_dynamic=bool({is_dynamic}),
|
|
183
|
-
sample_count={DATAFRAME_ANALYSIS_MAX_COLUMNS},
|
|
184
|
-
)
|
|
185
|
-
output_transformed.append(output_tf)
|
|
186
|
-
|
|
187
|
-
output_transformed = output_transformed[:{DATAFRAME_SAMPLE_COUNT_PREVIEW}]
|
|
188
|
-
|
|
189
|
-
try:
|
|
190
|
-
_json_string = simplejson.dumps(
|
|
191
|
-
combine_transformed_output_for_multi_output(output_transformed),
|
|
192
|
-
default=encode_complex,
|
|
193
|
-
ignore_nan=True,
|
|
194
|
-
)
|
|
195
|
-
|
|
196
|
-
return print(f'[__internal_output__]{{_json_string}}')
|
|
197
|
-
except Exception as err:
|
|
198
|
-
print(type(_internal_output_return))
|
|
199
|
-
print(type(output_transformed))
|
|
200
|
-
raise err
|
|
201
|
-
elif bool({is_dynamic}):
|
|
202
|
-
_json_string = simplejson.dumps(
|
|
203
|
-
transform_output_for_display(
|
|
204
|
-
_internal_output_return,
|
|
205
|
-
sample_count={DATAFRAME_ANALYSIS_MAX_COLUMNS},
|
|
206
|
-
),
|
|
207
|
-
default=encode_complex,
|
|
208
|
-
ignore_nan=True,
|
|
209
|
-
)
|
|
210
|
-
return print(f'[__internal_output__]{{_json_string}}')
|
|
211
|
-
elif bool({has_reduce_output}) and bool({is_dynamic_child}):
|
|
212
|
-
_json_string = simplejson.dumps(
|
|
213
|
-
transform_output_for_display_reduce_output(
|
|
214
|
-
_internal_output_return,
|
|
215
|
-
sample_count={DATAFRAME_ANALYSIS_MAX_COLUMNS},
|
|
216
|
-
),
|
|
217
|
-
default=encode_complex,
|
|
218
|
-
ignore_nan=True,
|
|
219
|
-
)
|
|
220
|
-
return print(f'[__internal_output__]{{_json_string}}')
|
|
221
|
-
elif isinstance(_internal_output_return, pd.DataFrame) and (
|
|
222
|
-
type(_internal_output_return).__module__ != 'geopandas.geodataframe'
|
|
223
|
-
):
|
|
224
|
-
_sample = _internal_output_return.iloc[:{DATAFRAME_SAMPLE_COUNT_PREVIEW}]
|
|
225
|
-
_columns = _sample.columns.tolist()[:{DATAFRAME_ANALYSIS_MAX_COLUMNS}]
|
|
226
|
-
for col in _columns:
|
|
227
|
-
try:
|
|
228
|
-
_sample[col] = _sample[col].fillna('')
|
|
229
|
-
except Exception:
|
|
230
|
-
pass
|
|
231
|
-
_rows = simplejson.loads(_sample[_columns].to_json(
|
|
232
|
-
date_format='iso',
|
|
233
|
-
default_handler=str,
|
|
234
|
-
orient='split',
|
|
235
|
-
))['data']
|
|
236
|
-
_shape = _internal_output_return.shape
|
|
237
|
-
_index = _sample.index.tolist()
|
|
238
|
-
|
|
239
|
-
_json_string = simplejson.dumps(
|
|
240
|
-
dict(
|
|
241
|
-
data=dict(
|
|
242
|
-
columns=_columns,
|
|
243
|
-
index=_index,
|
|
244
|
-
rows=_rows,
|
|
245
|
-
shape=_shape,
|
|
246
|
-
),
|
|
247
|
-
type='table',
|
|
248
|
-
),
|
|
249
|
-
default=encode_complex,
|
|
250
|
-
ignore_nan=True,
|
|
251
|
-
)
|
|
252
|
-
return print(f'[__internal_output__]{{_json_string}}')
|
|
253
|
-
elif isinstance(_internal_output_return, pl.DataFrame):
|
|
254
|
-
return print(_internal_output_return)
|
|
255
|
-
elif type(_internal_output_return).__module__ == 'pyspark.sql.dataframe':
|
|
256
|
-
_sample = _internal_output_return.limit({DATAFRAME_SAMPLE_COUNT_PREVIEW}).toPandas()
|
|
257
|
-
_columns = _sample.columns.tolist()[:40]
|
|
258
|
-
_rows = _sample.to_numpy().tolist()
|
|
259
|
-
_shape = [_internal_output_return.count(), len(_sample.columns.tolist())]
|
|
260
|
-
_index = _sample.index.tolist()
|
|
261
|
-
|
|
262
|
-
_json_string = simplejson.dumps(
|
|
263
|
-
dict(
|
|
264
|
-
data=dict(
|
|
265
|
-
columns=_columns,
|
|
266
|
-
index=_index,
|
|
267
|
-
rows=_rows,
|
|
268
|
-
shape=_shape,
|
|
269
|
-
),
|
|
270
|
-
type='table',
|
|
271
|
-
),
|
|
272
|
-
default=encode_complex,
|
|
273
|
-
ignore_nan=True,
|
|
274
|
-
)
|
|
275
|
-
return print(f'[__internal_output__]{{_json_string}}')
|
|
276
|
-
elif not {is_print_statement}:
|
|
277
|
-
output, sampled = sample_output(encode_complex(_internal_output_return))
|
|
278
|
-
if sampled:
|
|
279
|
-
print('Sampled output is provided here for preview.')
|
|
280
|
-
return output
|
|
281
|
-
|
|
282
|
-
return
|
|
178
|
+
{custom_output_function_code}
|
|
283
179
|
|
|
284
180
|
__custom_output()
|
|
285
181
|
"""
|
|
@@ -291,37 +187,48 @@ __custom_output()
|
|
|
291
187
|
return custom_code
|
|
292
188
|
|
|
293
189
|
|
|
190
|
+
def __interpolate_code_content(
|
|
191
|
+
file_name: str,
|
|
192
|
+
replacements: List[Tuple[str, Union[bool, float, int, str, Dict[str, Any]]]],
|
|
193
|
+
) -> str:
|
|
194
|
+
current_directory = os.path.dirname(__file__)
|
|
195
|
+
path_to_file = os.path.join(current_directory, file_name)
|
|
196
|
+
|
|
197
|
+
with open(path_to_file, 'r') as file:
|
|
198
|
+
content = file.read()
|
|
199
|
+
|
|
200
|
+
for placeholder, replacement in replacements:
|
|
201
|
+
placeholder_pattern = f"'{{{placeholder}}}'"
|
|
202
|
+
content = re.sub(placeholder_pattern, str(replacement), content)
|
|
203
|
+
|
|
204
|
+
return content
|
|
205
|
+
|
|
206
|
+
|
|
294
207
|
def add_execution_code(
|
|
295
208
|
pipeline_uuid: str,
|
|
296
209
|
block_uuid: str,
|
|
297
210
|
code: str,
|
|
298
211
|
global_vars,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
212
|
+
repo_path: str,
|
|
213
|
+
block_type: Optional[BlockType] = None,
|
|
214
|
+
execution_uuid: Optional[str] = None,
|
|
215
|
+
extension_uuid: Optional[str] = None,
|
|
216
|
+
kernel_name: Optional[str] = None,
|
|
303
217
|
output_messages_to_logs: bool = False,
|
|
304
|
-
pipeline_config: Dict = None,
|
|
305
|
-
|
|
218
|
+
pipeline_config: Optional[Dict] = None,
|
|
219
|
+
pipeline_config_json_encoded: Optional[str] = None,
|
|
220
|
+
repo_config: Optional[Dict] = None,
|
|
221
|
+
repo_config_json_encoded: Optional[str] = None,
|
|
306
222
|
run_incomplete_upstream: bool = False,
|
|
307
|
-
run_settings: Dict = None,
|
|
223
|
+
run_settings: Optional[Dict] = None,
|
|
308
224
|
run_tests: bool = False,
|
|
309
225
|
run_upstream: bool = False,
|
|
310
226
|
update_status: bool = True,
|
|
311
|
-
upstream_blocks: List[str] = None,
|
|
312
|
-
variables: Dict = None,
|
|
227
|
+
upstream_blocks: Optional[List[str]] = None,
|
|
228
|
+
variables: Optional[Dict] = None,
|
|
313
229
|
widget: bool = False,
|
|
314
230
|
) -> str:
|
|
315
|
-
escaped_code = code.replace("'''", "
|
|
316
|
-
|
|
317
|
-
if execution_uuid:
|
|
318
|
-
execution_uuid = f"'{execution_uuid}'"
|
|
319
|
-
|
|
320
|
-
if extension_uuid:
|
|
321
|
-
extension_uuid = f"'{extension_uuid}'"
|
|
322
|
-
if upstream_blocks:
|
|
323
|
-
upstream_blocks = ', '.join([f"'{u}'" for u in upstream_blocks])
|
|
324
|
-
upstream_blocks = f'[{upstream_blocks}]'
|
|
231
|
+
escaped_code = code.replace("'''", '"""').replace("\\", "\\\\")
|
|
325
232
|
|
|
326
233
|
run_settings_json = json.dumps(run_settings or {})
|
|
327
234
|
|
|
@@ -337,147 +244,71 @@ def add_execution_code(
|
|
|
337
244
|
else:
|
|
338
245
|
if block_type in [BlockType.DATA_LOADER, BlockType.TRANSFORMER]:
|
|
339
246
|
magic_header = '%%spark -o df --maxrows 10000'
|
|
340
|
-
elif pipeline_config['type'] == 'databricks':
|
|
341
|
-
spark_session_init =
|
|
247
|
+
elif pipeline_config and pipeline_config['type'] == 'databricks':
|
|
248
|
+
spark_session_init = """
|
|
342
249
|
from pyspark.sql import SparkSession
|
|
343
250
|
spark = SparkSession.builder.getOrCreate()
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return f"""{magic_header}
|
|
347
|
-
from mage_ai.data_preparation.models.block.dynamic.utils import build_combinations_for_dynamic_child
|
|
348
|
-
from mage_ai.data_preparation.models.block.dynamic.utils import has_reduce_output_from_upstreams
|
|
349
|
-
from mage_ai.data_preparation.models.block.dynamic.utils import is_dynamic_block
|
|
350
|
-
from mage_ai.data_preparation.models.block.dynamic.utils import is_dynamic_block_child
|
|
351
|
-
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
352
|
-
from mage_ai.settings.repo import get_repo_path
|
|
353
|
-
from mage_ai.orchestration.db import db_connection
|
|
354
|
-
from mage_ai.shared.array import find
|
|
355
|
-
from mage_ai.shared.hash import merge_dict
|
|
356
|
-
import datetime
|
|
357
|
-
import json
|
|
358
|
-
import logging
|
|
359
|
-
import pandas as pd
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
db_connection.start_session()
|
|
363
|
-
{spark_session_init}
|
|
364
|
-
|
|
365
|
-
if 'context' not in globals():
|
|
366
|
-
context = dict()
|
|
367
|
-
|
|
368
|
-
def execute_custom_code():
|
|
369
|
-
block_uuid=\'{block_uuid}\'
|
|
370
|
-
run_incomplete_upstream={str(run_incomplete_upstream)}
|
|
371
|
-
run_upstream={str(run_upstream)}
|
|
372
|
-
pipeline = Pipeline(
|
|
373
|
-
uuid=\'{pipeline_uuid}\',
|
|
374
|
-
config={pipeline_config},
|
|
375
|
-
repo_config={repo_config},
|
|
376
|
-
)
|
|
377
|
-
|
|
378
|
-
block = pipeline.get_block(block_uuid, extension_uuid={extension_uuid}, widget={widget})
|
|
379
|
-
|
|
380
|
-
upstream_blocks = {upstream_blocks}
|
|
381
|
-
if upstream_blocks and len(upstream_blocks) >= 1:
|
|
382
|
-
blocks = pipeline.get_blocks({upstream_blocks})
|
|
383
|
-
block.upstream_blocks = blocks
|
|
251
|
+
"""
|
|
384
252
|
|
|
385
|
-
|
|
253
|
+
replacements = [
|
|
254
|
+
('DATAFRAME_SAMPLE_COUNT_PREVIEW', DATAFRAME_SAMPLE_COUNT_PREVIEW),
|
|
255
|
+
('block_uuid', f"'{block_uuid}'"),
|
|
256
|
+
(
|
|
257
|
+
'escaped_code',
|
|
258
|
+
f"""r\'\'\'
|
|
386
259
|
{escaped_code}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
260
|
+
\'\'\'""",
|
|
261
|
+
),
|
|
262
|
+
('global_vars', global_vars),
|
|
263
|
+
('output_messages_to_logs', output_messages_to_logs),
|
|
264
|
+
('pipeline_config_json_encoded', f"'{pipeline_config_json_encoded}'"),
|
|
265
|
+
('pipeline_uuid', f"'{pipeline_uuid}'"),
|
|
266
|
+
('repo_config_json_encoded', f"'{repo_config_json_encoded}'"),
|
|
267
|
+
('repo_path', f"'{repo_path}'"),
|
|
268
|
+
('run_incomplete_upstream', run_incomplete_upstream),
|
|
269
|
+
('run_settings_json', f"'{run_settings_json}'"),
|
|
270
|
+
('run_tests', run_tests),
|
|
271
|
+
('run_upstream', run_upstream),
|
|
272
|
+
('spark', 'spark'),
|
|
273
|
+
('spark_session_init', f"'{spark_session_init}'"),
|
|
274
|
+
('update_status', update_status),
|
|
275
|
+
('variables', variables),
|
|
276
|
+
('widget', widget),
|
|
277
|
+
]
|
|
397
278
|
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
except Exception:
|
|
401
|
-
pass
|
|
402
|
-
|
|
403
|
-
if run_incomplete_upstream or run_upstream:
|
|
404
|
-
block.run_upstream_blocks(
|
|
405
|
-
from_notebook=True,
|
|
406
|
-
global_vars=global_vars,
|
|
407
|
-
incomplete_only=run_incomplete_upstream,
|
|
408
|
-
)
|
|
279
|
+
if execution_uuid:
|
|
280
|
+
replacements.append(('execution_uuid', f"'{execution_uuid}'"))
|
|
409
281
|
|
|
410
|
-
|
|
411
|
-
logger.setLevel('INFO')
|
|
412
|
-
if 'logger' not in global_vars:
|
|
413
|
-
global_vars['logger'] = logger
|
|
282
|
+
replacements.append(('extension_uuid', f"'{extension_uuid}'" if extension_uuid else 'None'))
|
|
414
283
|
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
from_notebook=True,
|
|
420
|
-
global_vars=global_vars,
|
|
421
|
-
logger=logger,
|
|
422
|
-
output_messages_to_logs={output_messages_to_logs},
|
|
423
|
-
run_settings=json.loads('{run_settings_json}'),
|
|
424
|
-
update_status={update_status},
|
|
425
|
-
)
|
|
284
|
+
if upstream_blocks:
|
|
285
|
+
upstream_blocks = ', '.join([f"'{u}'" for u in upstream_blocks])
|
|
286
|
+
upstream_blocks = f'[{upstream_blocks}]'
|
|
287
|
+
replacements.append(('upstream_blocks', upstream_blocks))
|
|
426
288
|
|
|
427
|
-
|
|
428
|
-
is_dynamic_child = is_dynamic_block_child(block)
|
|
429
|
-
|
|
430
|
-
if is_dynamic_child:
|
|
431
|
-
outputs = []
|
|
432
|
-
settings = build_combinations_for_dynamic_child(block, **options)
|
|
433
|
-
for dynamic_block_index, config in enumerate(settings):
|
|
434
|
-
output_dict = block.execute_with_callback(**merge_dict(options, config))
|
|
435
|
-
if output_dict and output_dict.get('output'):
|
|
436
|
-
outputs.append(output_dict.get('output'))
|
|
437
|
-
|
|
438
|
-
if {run_tests}:
|
|
439
|
-
block.run_tests(
|
|
440
|
-
custom_code=code,
|
|
441
|
-
dynamic_block_index=dynamic_block_index,
|
|
442
|
-
from_notebook=True,
|
|
443
|
-
logger=logger,
|
|
444
|
-
global_vars=global_vars,
|
|
445
|
-
update_tests=False,
|
|
446
|
-
)
|
|
447
|
-
|
|
448
|
-
block_output['output'] = outputs
|
|
449
|
-
else:
|
|
450
|
-
block_output = block.execute_with_callback(**options)
|
|
289
|
+
code_content = __interpolate_code_content('execute_custom_code.py', replacements)
|
|
451
290
|
|
|
452
|
-
|
|
453
|
-
block.run_tests(
|
|
454
|
-
custom_code=code,
|
|
455
|
-
from_notebook=True,
|
|
456
|
-
logger=logger,
|
|
457
|
-
global_vars=global_vars,
|
|
458
|
-
update_tests=False,
|
|
459
|
-
)
|
|
291
|
+
return f"""{magic_header}
|
|
460
292
|
|
|
461
|
-
|
|
293
|
+
import datetime
|
|
462
294
|
|
|
463
|
-
|
|
464
|
-
return output
|
|
465
|
-
else:
|
|
466
|
-
return find(lambda val: val is not None, output)
|
|
295
|
+
{code_content}
|
|
467
296
|
|
|
468
|
-
df = execute_custom_code()
|
|
469
|
-
|
|
297
|
+
df = await execute_custom_code()
|
|
298
|
+
"""
|
|
470
299
|
|
|
471
300
|
|
|
472
301
|
def get_block_output_process_code(
|
|
473
302
|
pipeline_uuid: str,
|
|
474
303
|
block_uuid: str,
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
304
|
+
repo_path: str,
|
|
305
|
+
block_type: Optional[BlockType] = None,
|
|
306
|
+
kernel_name: Optional[str] = None,
|
|
478
307
|
):
|
|
479
|
-
if kernel_name != KernelName.PYSPARK or
|
|
480
|
-
|
|
308
|
+
if kernel_name != KernelName.PYSPARK or block_type not in [
|
|
309
|
+
BlockType.DATA_LOADER,
|
|
310
|
+
BlockType.TRANSFORMER,
|
|
311
|
+
]:
|
|
481
312
|
return None
|
|
482
313
|
return f"""%%local
|
|
483
314
|
from mage_ai.data_preparation.models.constants import BlockStatus
|
|
@@ -488,6 +319,7 @@ import pandas
|
|
|
488
319
|
block_uuid=\'{block_uuid}\'
|
|
489
320
|
pipeline = Pipeline(
|
|
490
321
|
uuid=\'{pipeline_uuid}\',
|
|
322
|
+
repo_path=\'{repo_path}\',
|
|
491
323
|
)
|
|
492
324
|
block = pipeline.get_block(block_uuid)
|
|
493
325
|
variable_mapping = dict(df=df)
|
|
@@ -499,19 +331,20 @@ block.update_status(BlockStatus.EXECUTED)
|
|
|
499
331
|
|
|
500
332
|
def get_pipeline_execution_code(
|
|
501
333
|
pipeline_uuid: str,
|
|
502
|
-
|
|
334
|
+
repo_path: str,
|
|
335
|
+
global_vars: Optional[Dict] = None,
|
|
503
336
|
kernel_name: str = None,
|
|
504
|
-
pipeline_config: Dict = None,
|
|
505
|
-
repo_config: Dict = None,
|
|
337
|
+
pipeline_config: Optional[Dict] = None,
|
|
338
|
+
repo_config: Optional[Dict] = None,
|
|
506
339
|
update_status: bool = True,
|
|
507
340
|
) -> str:
|
|
508
341
|
spark_session_init = ''
|
|
509
342
|
if pipeline_config['type'] == 'databricks':
|
|
510
|
-
spark_session_init =
|
|
343
|
+
spark_session_init = """
|
|
511
344
|
from pyspark.sql import SparkSession
|
|
512
345
|
import os
|
|
513
346
|
spark = SparkSession.builder.master(os.getenv('SPARK_MASTER_HOST', 'local')).getOrCreate()
|
|
514
|
-
|
|
347
|
+
"""
|
|
515
348
|
|
|
516
349
|
return f"""
|
|
517
350
|
from mage_ai.data_preparation.models.pipeline import Pipeline
|
|
@@ -522,6 +355,7 @@ import asyncio
|
|
|
522
355
|
def execute_pipeline():
|
|
523
356
|
pipeline = Pipeline(
|
|
524
357
|
uuid=\'{pipeline_uuid}\',
|
|
358
|
+
repo_path=\'{repo_path}\',
|
|
525
359
|
config={pipeline_config},
|
|
526
360
|
repo_config={repo_config},
|
|
527
361
|
)
|