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
|
File without changes
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
from typing import Any, Dict, List, Optional, Union
|
|
3
|
+
|
|
4
|
+
from mage_ai.data_preparation.models.variables.constants import VariableType
|
|
5
|
+
from mage_ai.shared.models import BaseDataClass
|
|
6
|
+
from mage_ai.system.models import ResourceUsage
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
@dataclass
|
|
10
|
+
class VariableTypeInformation(BaseDataClass):
|
|
11
|
+
type: VariableType
|
|
12
|
+
|
|
13
|
+
def __post_init__(self):
|
|
14
|
+
self.serialize_attribute_enum('type', VariableType)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
@dataclass
|
|
18
|
+
class StatisticsInformation(BaseDataClass):
|
|
19
|
+
original_column_count: Optional[int] = None
|
|
20
|
+
original_row_count: Optional[int] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
InformationData = Optional[
|
|
24
|
+
Union[
|
|
25
|
+
Dict[str, Any],
|
|
26
|
+
ResourceUsage,
|
|
27
|
+
StatisticsInformation,
|
|
28
|
+
VariableTypeInformation,
|
|
29
|
+
]
|
|
30
|
+
]
|
|
31
|
+
AggregateInformationData = List[InformationData]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@dataclass
|
|
35
|
+
class AggregateInformation(BaseDataClass):
|
|
36
|
+
insights: Optional[
|
|
37
|
+
Union[
|
|
38
|
+
List[Dict[str, Any]],
|
|
39
|
+
List[List[Dict[str, Any]]],
|
|
40
|
+
]
|
|
41
|
+
] = None
|
|
42
|
+
metadata: Optional[
|
|
43
|
+
Union[
|
|
44
|
+
List[Dict[str, Any]],
|
|
45
|
+
List[List[Dict[str, Any]]],
|
|
46
|
+
]
|
|
47
|
+
] = None
|
|
48
|
+
resource_usage: Optional[
|
|
49
|
+
Union[
|
|
50
|
+
List[ResourceUsage],
|
|
51
|
+
List[List[ResourceUsage]],
|
|
52
|
+
]
|
|
53
|
+
] = None
|
|
54
|
+
sample_data: Optional[
|
|
55
|
+
Union[
|
|
56
|
+
List[Dict[str, Any]],
|
|
57
|
+
List[List[Dict[str, Any]]],
|
|
58
|
+
]
|
|
59
|
+
] = None
|
|
60
|
+
statistics: Optional[
|
|
61
|
+
Union[
|
|
62
|
+
List[StatisticsInformation],
|
|
63
|
+
List[List[StatisticsInformation]],
|
|
64
|
+
]
|
|
65
|
+
] = None
|
|
66
|
+
suggestions: Optional[
|
|
67
|
+
Union[
|
|
68
|
+
List[Dict[str, Any]],
|
|
69
|
+
List[List[Dict[str, Any]]],
|
|
70
|
+
]
|
|
71
|
+
] = None
|
|
72
|
+
type: Optional[
|
|
73
|
+
Union[
|
|
74
|
+
List[VariableTypeInformation],
|
|
75
|
+
List[List[VariableTypeInformation]],
|
|
76
|
+
]
|
|
77
|
+
] = None
|
|
78
|
+
|
|
79
|
+
def __post_init__(self):
|
|
80
|
+
if self.resource_usage and isinstance(self.resource_usage, list):
|
|
81
|
+
arr = []
|
|
82
|
+
for item in self.resource_usage:
|
|
83
|
+
if item and isinstance(item, dict):
|
|
84
|
+
arr.append(ResourceUsage.load(**item))
|
|
85
|
+
elif isinstance(item, ResourceUsage):
|
|
86
|
+
arr.append(ResourceUsage)
|
|
87
|
+
elif isinstance(item, list):
|
|
88
|
+
arr_nested = []
|
|
89
|
+
for item_nested in item:
|
|
90
|
+
if item_nested and isinstance(item_nested, dict):
|
|
91
|
+
arr_nested.append(ResourceUsage.load(**item_nested))
|
|
92
|
+
elif isinstance(item_nested, ResourceUsage):
|
|
93
|
+
arr_nested.append(ResourceUsage)
|
|
94
|
+
arr.append(arr_nested)
|
|
95
|
+
self.resource_usage = arr
|
|
96
|
+
|
|
97
|
+
if self.statistics and isinstance(self.statistics, list):
|
|
98
|
+
arr = []
|
|
99
|
+
for item in self.statistics:
|
|
100
|
+
if item and isinstance(item, dict):
|
|
101
|
+
arr.append(StatisticsInformation.load(**item))
|
|
102
|
+
elif isinstance(item, StatisticsInformation):
|
|
103
|
+
arr.append(StatisticsInformation)
|
|
104
|
+
elif isinstance(item, list):
|
|
105
|
+
arr_nested = []
|
|
106
|
+
for item_nested in item:
|
|
107
|
+
if item_nested and isinstance(item_nested, dict):
|
|
108
|
+
arr_nested.append(StatisticsInformation.load(**item_nested))
|
|
109
|
+
elif isinstance(item_nested, StatisticsInformation):
|
|
110
|
+
arr_nested.append(StatisticsInformation)
|
|
111
|
+
arr.append(arr_nested)
|
|
112
|
+
self.statistics = arr
|
|
113
|
+
|
|
114
|
+
if self.type and isinstance(self.type, list):
|
|
115
|
+
arr = []
|
|
116
|
+
for item in self.type:
|
|
117
|
+
if item and isinstance(item, dict):
|
|
118
|
+
arr.append(VariableTypeInformation.load(**item))
|
|
119
|
+
elif isinstance(item, VariableTypeInformation):
|
|
120
|
+
arr.append(VariableTypeInformation)
|
|
121
|
+
elif isinstance(item, list):
|
|
122
|
+
arr_nested = []
|
|
123
|
+
for item_nested in item:
|
|
124
|
+
if item_nested and isinstance(item_nested, dict):
|
|
125
|
+
arr_nested.append(VariableTypeInformation.load(**item_nested))
|
|
126
|
+
elif isinstance(item_nested, VariableTypeInformation):
|
|
127
|
+
arr_nested.append(VariableTypeInformation)
|
|
128
|
+
arr.append(arr_nested)
|
|
129
|
+
self.type = arr
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
@dataclass
|
|
133
|
+
class VariableAggregateCache(BaseDataClass):
|
|
134
|
+
dynamic: Optional[AggregateInformation] = None
|
|
135
|
+
insights: Optional[Dict[str, Any]] = None
|
|
136
|
+
metadata: Optional[Dict[str, Any]] = None
|
|
137
|
+
parts: Optional[AggregateInformation] = None
|
|
138
|
+
resource_usage: Optional[ResourceUsage] = None
|
|
139
|
+
sample_data: Optional[Dict[str, Any]] = None
|
|
140
|
+
statistics: Optional[StatisticsInformation] = None
|
|
141
|
+
suggestions: Optional[Dict[str, Any]] = None
|
|
142
|
+
type: Optional[VariableTypeInformation] = None
|
|
143
|
+
|
|
144
|
+
def __post_init__(self):
|
|
145
|
+
self.serialize_attribute_class('dynamic', AggregateInformation)
|
|
146
|
+
self.serialize_attribute_class('parts', AggregateInformation)
|
|
147
|
+
self.serialize_attribute_class('resource_usage', ResourceUsage)
|
|
148
|
+
self.serialize_attribute_class('statistics', StatisticsInformation)
|
|
149
|
+
self.serialize_attribute_class('type', VariableTypeInformation)
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
|
|
3
|
+
CONFIG_JSON_FILE = 'config.json'
|
|
4
|
+
DATAFRAME_COLUMN_TYPES_FILE = 'data_column_types.json'
|
|
5
|
+
DATAFRAME_CSV_FILE = 'data.csv'
|
|
6
|
+
DATAFRAME_PARQUET_FILE = 'data.parquet'
|
|
7
|
+
DATAFRAME_PARQUET_SAMPLE_FILE = 'sample_data.parquet'
|
|
8
|
+
JOBLIB_FILE = 'model.joblib'
|
|
9
|
+
JOBLIB_OBJECT_FILE = 'object.joblib'
|
|
10
|
+
JSON_FILE = 'data.json'
|
|
11
|
+
MATRIX_NPZ_FILE = 'matrix.npz'
|
|
12
|
+
MATRIX_SAMPLE_NPZ_FILE = 'matrix.npz'
|
|
13
|
+
MEDIA_IMAGE_VISUALIZATION_FILE = 'visualization.png'
|
|
14
|
+
UBJSON_MODEL_FILENAME = 'model.ubj'
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class VariableType(str, Enum):
|
|
18
|
+
CUSTOM_OBJECT = 'custom_object'
|
|
19
|
+
DATAFRAME = 'dataframe'
|
|
20
|
+
DATAFRAME_ANALYSIS = 'dataframe_analysis'
|
|
21
|
+
DICTIONARY_COMPLEX = 'dictionary_complex'
|
|
22
|
+
GEO_DATAFRAME = 'geo_dataframe'
|
|
23
|
+
ITERABLE = 'iterable'
|
|
24
|
+
LIST_COMPLEX = 'list_complex'
|
|
25
|
+
MATRIX_SPARSE = 'matrix_sparse'
|
|
26
|
+
MODEL_SKLEARN = 'model_sklearn'
|
|
27
|
+
MODEL_XGBOOST = 'model_xgboost'
|
|
28
|
+
POLARS_DATAFRAME = 'polars_dataframe'
|
|
29
|
+
SERIES_PANDAS = 'series_pandas'
|
|
30
|
+
SERIES_POLARS = 'series_polars'
|
|
31
|
+
SPARK_DATAFRAME = 'spark_dataframe'
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class VariableAggregateDataType(str, Enum):
|
|
35
|
+
INSIGHTS = 'insights'
|
|
36
|
+
METADATA = 'metadata'
|
|
37
|
+
RESOURCE_USAGE = 'resource_usage'
|
|
38
|
+
SAMPLE_DATA = 'sample_data'
|
|
39
|
+
STATISTICS = 'statistics'
|
|
40
|
+
SUGGESTIONS = 'suggestions'
|
|
41
|
+
TYPE = 'type'
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class VariableAggregateDataTypeFilename(str, Enum):
|
|
45
|
+
INSIGHTS = f'{VariableAggregateDataType.INSIGHTS}.json'
|
|
46
|
+
METADATA = f'{VariableAggregateDataType.METADATA}.json'
|
|
47
|
+
RESOURCE_USAGE = f'{VariableAggregateDataType.RESOURCE_USAGE}.json'
|
|
48
|
+
SAMPLE_DATA = f'{VariableAggregateDataType.SAMPLE_DATA}.json'
|
|
49
|
+
STATISTICS = f'{VariableAggregateDataType.STATISTICS}.json'
|
|
50
|
+
SUGGESTIONS = f'{VariableAggregateDataType.SUGGESTIONS}.json'
|
|
51
|
+
TYPE = f'{VariableAggregateDataType.TYPE}.json'
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
DATA_TYPE_FILENAME = {
|
|
55
|
+
VariableAggregateDataType.INSIGHTS: VariableAggregateDataTypeFilename.INSIGHTS,
|
|
56
|
+
VariableAggregateDataType.METADATA: VariableAggregateDataTypeFilename.METADATA,
|
|
57
|
+
VariableAggregateDataType.RESOURCE_USAGE: VariableAggregateDataTypeFilename.RESOURCE_USAGE,
|
|
58
|
+
VariableAggregateDataType.SAMPLE_DATA: VariableAggregateDataTypeFilename.SAMPLE_DATA,
|
|
59
|
+
VariableAggregateDataType.STATISTICS: VariableAggregateDataTypeFilename.STATISTICS,
|
|
60
|
+
VariableAggregateDataType.SUGGESTIONS: VariableAggregateDataTypeFilename.SUGGESTIONS,
|
|
61
|
+
VariableAggregateDataType.TYPE: VariableAggregateDataTypeFilename.TYPE,
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
RESOURCE_USAGE_FILE = VariableAggregateDataTypeFilename.RESOURCE_USAGE.value
|
|
66
|
+
JSON_SAMPLE_FILE = VariableAggregateDataTypeFilename.SAMPLE_DATA.value
|
|
67
|
+
METADATA_FILE = VariableAggregateDataTypeFilename.TYPE.value
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class VariableAggregateSummaryGroupType(str, Enum):
|
|
71
|
+
DYNAMIC = 'dynamic'
|
|
72
|
+
PARTS = 'parts'
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import List, Optional, Tuple
|
|
3
|
+
|
|
4
|
+
from mage_ai.data_preparation.models.variables.cache import (
|
|
5
|
+
AggregateInformation,
|
|
6
|
+
VariableAggregateCache,
|
|
7
|
+
VariableTypeInformation,
|
|
8
|
+
)
|
|
9
|
+
from mage_ai.data_preparation.models.variables.constants import (
|
|
10
|
+
DATA_TYPE_FILENAME,
|
|
11
|
+
VariableAggregateDataType,
|
|
12
|
+
VariableAggregateDataTypeFilename,
|
|
13
|
+
VariableAggregateSummaryGroupType,
|
|
14
|
+
)
|
|
15
|
+
from mage_ai.data_preparation.models.variables.utils import is_output_variable
|
|
16
|
+
from mage_ai.shared.utils import clean_name
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def aggregate_summary_info_for_all_variables(
|
|
20
|
+
variable_manager,
|
|
21
|
+
pipeline_uuid: str,
|
|
22
|
+
block_uuid: str, # Make sure this is the base block_uuid, not with the dynamic block index
|
|
23
|
+
partition: Optional[str] = None,
|
|
24
|
+
):
|
|
25
|
+
block_uuid = clean_name(block_uuid)
|
|
26
|
+
variable_uuids = variable_manager.get_variables_by_block(
|
|
27
|
+
pipeline_uuid,
|
|
28
|
+
block_uuid,
|
|
29
|
+
partition=partition,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
if variable_uuids and all(not is_output_variable(v) for v in variable_uuids):
|
|
33
|
+
"""
|
|
34
|
+
Dynamic child blocks have this directory structure:
|
|
35
|
+
[block_uuid]/
|
|
36
|
+
[dynamic_block_index]/
|
|
37
|
+
[variable_uuid]/
|
|
38
|
+
"""
|
|
39
|
+
variable_uuids = variable_manager.get_variables_by_block(
|
|
40
|
+
pipeline_uuid,
|
|
41
|
+
os.path.join(block_uuid, str(variable_uuids[0])),
|
|
42
|
+
clean_block_uuid=False,
|
|
43
|
+
partition=partition,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
for variable_uuid in variable_uuids:
|
|
47
|
+
variable = variable_manager.get_variable_object(
|
|
48
|
+
pipeline_uuid,
|
|
49
|
+
block_uuid,
|
|
50
|
+
variable_uuid,
|
|
51
|
+
partition=partition,
|
|
52
|
+
skip_check_variable_type=True,
|
|
53
|
+
)
|
|
54
|
+
__aggregate_summary_info(variable)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def __aggregate_summary_info(variable):
|
|
58
|
+
"""
|
|
59
|
+
Only consolidate summary files if at least 1 of the following criteria are met:
|
|
60
|
+
- Dynamic child block
|
|
61
|
+
- Variable has parts (e.g. output_0/[part_uuid])
|
|
62
|
+
Consolidate summary files from all subfolders (except data.json):
|
|
63
|
+
- insights.json
|
|
64
|
+
- metadata.json
|
|
65
|
+
- resources.json
|
|
66
|
+
- sample_data.json
|
|
67
|
+
- statistics.json
|
|
68
|
+
- suggestions.json
|
|
69
|
+
- type.json
|
|
70
|
+
|
|
71
|
+
Directory structure
|
|
72
|
+
[block_uuid]/ -> variable.variable_dir_path
|
|
73
|
+
[variable_uuid: output_0]/ -> variable.variable_path
|
|
74
|
+
0/
|
|
75
|
+
type.json
|
|
76
|
+
1/
|
|
77
|
+
type.json
|
|
78
|
+
type.json
|
|
79
|
+
[dynamic_block_index]/
|
|
80
|
+
[variable_uuid: output_0]/
|
|
81
|
+
0/
|
|
82
|
+
type.json
|
|
83
|
+
1/
|
|
84
|
+
type.json
|
|
85
|
+
type.json
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
filenames = [key.value for key in VariableAggregateDataTypeFilename]
|
|
89
|
+
|
|
90
|
+
"""
|
|
91
|
+
[block_uuid]/ -> variable.variable_dir_path
|
|
92
|
+
[variable_uuid: output_0]/ -> variable.variable_path
|
|
93
|
+
0/
|
|
94
|
+
type.json
|
|
95
|
+
1/
|
|
96
|
+
type.json
|
|
97
|
+
type.json
|
|
98
|
+
"""
|
|
99
|
+
mapping_parts = {}
|
|
100
|
+
if variable.part_uuids:
|
|
101
|
+
for part_uuid in variable.part_uuids: # part_uuid: 0/
|
|
102
|
+
for filename in filenames: # filename: type.json
|
|
103
|
+
if not mapping_parts.get(filename):
|
|
104
|
+
mapping_parts[filename] = []
|
|
105
|
+
|
|
106
|
+
file_path = os.path.join(variable.variable_path, part_uuid, filename)
|
|
107
|
+
if variable.storage.path_exists(file_path):
|
|
108
|
+
mapping_parts[filename].append(
|
|
109
|
+
variable.storage.read_json_file(
|
|
110
|
+
file_path,
|
|
111
|
+
default_value={},
|
|
112
|
+
raise_exception=False,
|
|
113
|
+
),
|
|
114
|
+
)
|
|
115
|
+
else:
|
|
116
|
+
mapping_parts[filename].append({})
|
|
117
|
+
|
|
118
|
+
"""
|
|
119
|
+
[block_uuid]/ -> variable.variable_dir_path
|
|
120
|
+
[dynamic_block_index]/ -> [read all of them]
|
|
121
|
+
[variable_uuid: output_0]/ -> variable.uuid
|
|
122
|
+
0/
|
|
123
|
+
type.json
|
|
124
|
+
1/
|
|
125
|
+
type.json
|
|
126
|
+
type.json
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
for dirname in VariableAggregateSummaryGroupType:
|
|
130
|
+
path = os.path.join(variable.variable_dir_path, dirname.value)
|
|
131
|
+
if variable.storage.path_exists(path):
|
|
132
|
+
variable.storage.remove_dir(path)
|
|
133
|
+
|
|
134
|
+
mapping_dynamic_blocks = {}
|
|
135
|
+
# dynamic_block_index: 0
|
|
136
|
+
# index_path: [block_uuid]/[dynamic_block_index: 0]/
|
|
137
|
+
# output_path: [block_uuid]/[dynamic_block_index: 0]/[variable_uuid: output_0]/
|
|
138
|
+
for _dynamic_block_index, _index_path, output_path in dynamic_block_index_paths(variable):
|
|
139
|
+
mapping_dynamic_children = {}
|
|
140
|
+
for filename in filenames: # filename: type.json
|
|
141
|
+
if not mapping_dynamic_children.get(filename):
|
|
142
|
+
mapping_dynamic_children[filename] = []
|
|
143
|
+
|
|
144
|
+
part_uuids = __get_part_uuids(variable, output_path)
|
|
145
|
+
if part_uuids and len(part_uuids) >= 1:
|
|
146
|
+
arr = []
|
|
147
|
+
for part_uuid in part_uuids:
|
|
148
|
+
part_path = os.path.join(output_path, part_uuid, filename)
|
|
149
|
+
if variable.storage.path_exists(part_path):
|
|
150
|
+
arr.append(
|
|
151
|
+
variable.storage.read_json_file(
|
|
152
|
+
part_path,
|
|
153
|
+
default_value={},
|
|
154
|
+
raise_exception=False,
|
|
155
|
+
),
|
|
156
|
+
)
|
|
157
|
+
mapping_dynamic_children[filename].append(arr)
|
|
158
|
+
else:
|
|
159
|
+
file_path = os.path.join(output_path, filename)
|
|
160
|
+
if variable.storage.path_exists(file_path):
|
|
161
|
+
mapping_dynamic_children[filename].append(
|
|
162
|
+
variable.storage.read_json_file(
|
|
163
|
+
file_path,
|
|
164
|
+
default_value={},
|
|
165
|
+
raise_exception=True,
|
|
166
|
+
),
|
|
167
|
+
)
|
|
168
|
+
else:
|
|
169
|
+
mapping_dynamic_children[filename].append({})
|
|
170
|
+
|
|
171
|
+
for filename, arr in mapping_dynamic_children.items():
|
|
172
|
+
if not mapping_dynamic_blocks.get(filename):
|
|
173
|
+
mapping_dynamic_blocks[filename] = []
|
|
174
|
+
mapping_dynamic_blocks[filename].append(arr)
|
|
175
|
+
|
|
176
|
+
for directory, mapping in [
|
|
177
|
+
(VariableAggregateSummaryGroupType.DYNAMIC, mapping_dynamic_blocks),
|
|
178
|
+
(VariableAggregateSummaryGroupType.PARTS, mapping_parts),
|
|
179
|
+
]:
|
|
180
|
+
if len(mapping) == 0:
|
|
181
|
+
continue
|
|
182
|
+
|
|
183
|
+
path = os.path.join(variable.variable_path, directory)
|
|
184
|
+
|
|
185
|
+
if not variable.storage.isdir(path):
|
|
186
|
+
variable.storage.makedirs(path, exist_ok=True)
|
|
187
|
+
|
|
188
|
+
for filename, data in mapping.items():
|
|
189
|
+
variable.storage.write_json_file(os.path.join(path, filename), data)
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
def get_aggregate_summary_info(
|
|
193
|
+
variable_manager,
|
|
194
|
+
pipeline_uuid: str,
|
|
195
|
+
block_uuid: str,
|
|
196
|
+
variable_uuid: str,
|
|
197
|
+
data_type: VariableAggregateDataType,
|
|
198
|
+
default_group_type: Optional[VariableAggregateSummaryGroupType] = None,
|
|
199
|
+
group_type: Optional[VariableAggregateSummaryGroupType] = None,
|
|
200
|
+
partition: Optional[str] = None,
|
|
201
|
+
) -> VariableAggregateCache:
|
|
202
|
+
variable = variable_manager.get_variable_object(
|
|
203
|
+
pipeline_uuid,
|
|
204
|
+
block_uuid,
|
|
205
|
+
variable_uuid,
|
|
206
|
+
partition=partition,
|
|
207
|
+
skip_check_variable_type=True,
|
|
208
|
+
)
|
|
209
|
+
return __get_aggregate_summary_info(
|
|
210
|
+
variable, data_type, default_group_type=default_group_type, group_type=group_type
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def __get_aggregate_summary_info(
|
|
215
|
+
variable,
|
|
216
|
+
data_type: VariableAggregateDataType,
|
|
217
|
+
default_group_type: Optional[VariableAggregateSummaryGroupType] = None,
|
|
218
|
+
group_type: Optional[VariableAggregateSummaryGroupType] = None,
|
|
219
|
+
) -> VariableAggregateCache:
|
|
220
|
+
"""
|
|
221
|
+
Get aggregate summary information for the variable.
|
|
222
|
+
|
|
223
|
+
Args:
|
|
224
|
+
group_type (VariableAggregateSummaryGroupType): Group type of the variable.
|
|
225
|
+
|
|
226
|
+
Returns:
|
|
227
|
+
Optional[AggregateInformationData]: Aggregate summary information for the variable.
|
|
228
|
+
|
|
229
|
+
Used
|
|
230
|
+
"""
|
|
231
|
+
cache = VariableAggregateCache()
|
|
232
|
+
|
|
233
|
+
path = os.path.join(
|
|
234
|
+
variable.variable_path,
|
|
235
|
+
group_type.value if group_type else '',
|
|
236
|
+
DATA_TYPE_FILENAME[data_type],
|
|
237
|
+
)
|
|
238
|
+
|
|
239
|
+
if variable.storage.path_exists(path):
|
|
240
|
+
data = variable.storage.read_json_file(
|
|
241
|
+
path,
|
|
242
|
+
default_value=None,
|
|
243
|
+
raise_exception=False,
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
if group_type:
|
|
247
|
+
group_info = getattr(cache, group_type.value)
|
|
248
|
+
group_info = AggregateInformation.load(
|
|
249
|
+
**(
|
|
250
|
+
group_info
|
|
251
|
+
if isinstance(group_info, dict)
|
|
252
|
+
else group_info.to_dict()
|
|
253
|
+
if group_info is not None
|
|
254
|
+
else {}
|
|
255
|
+
)
|
|
256
|
+
)
|
|
257
|
+
group_info.update_attributes(**{
|
|
258
|
+
data_type.value: data,
|
|
259
|
+
})
|
|
260
|
+
cache.update_attributes(**{
|
|
261
|
+
group_type.value: group_info,
|
|
262
|
+
})
|
|
263
|
+
else:
|
|
264
|
+
if (
|
|
265
|
+
VariableAggregateDataType.TYPE == data_type.value
|
|
266
|
+
and data is not None
|
|
267
|
+
and isinstance(data, dict)
|
|
268
|
+
):
|
|
269
|
+
if data.get('type'):
|
|
270
|
+
cache.update_attributes(**{
|
|
271
|
+
'type': VariableTypeInformation.load(type=data.get('type')),
|
|
272
|
+
})
|
|
273
|
+
|
|
274
|
+
if default_group_type is not None and data.get('types'):
|
|
275
|
+
var_types = data.get('types') or []
|
|
276
|
+
group_info = getattr(cache, default_group_type.value)
|
|
277
|
+
group_info = AggregateInformation.load(
|
|
278
|
+
**(
|
|
279
|
+
group_info
|
|
280
|
+
if isinstance(group_info, dict)
|
|
281
|
+
else group_info.to_dict()
|
|
282
|
+
if group_info is not None
|
|
283
|
+
else {}
|
|
284
|
+
)
|
|
285
|
+
)
|
|
286
|
+
group_info.update_attributes(**{
|
|
287
|
+
data_type.value: [
|
|
288
|
+
VariableTypeInformation.load(type=val) for val in var_types
|
|
289
|
+
],
|
|
290
|
+
})
|
|
291
|
+
cache.update_attributes(**{
|
|
292
|
+
default_group_type.value: group_info,
|
|
293
|
+
})
|
|
294
|
+
|
|
295
|
+
else:
|
|
296
|
+
cache.update_attributes(**{
|
|
297
|
+
data_type.value: data,
|
|
298
|
+
})
|
|
299
|
+
return VariableAggregateCache.load(**cache.to_dict())
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
def get_part_uuids(variable) -> Optional[List[str]]:
|
|
303
|
+
if (
|
|
304
|
+
not variable.uuid
|
|
305
|
+
or not is_output_variable(variable.uuid)
|
|
306
|
+
or not variable.storage.isdir(variable.variable_path)
|
|
307
|
+
):
|
|
308
|
+
return None
|
|
309
|
+
|
|
310
|
+
return __get_part_uuids(variable, variable.variable_path)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
def dynamic_block_index_paths(variable) -> List[Tuple[int, str, str]]:
|
|
314
|
+
if not variable.storage.isdir(variable.variable_dir_path):
|
|
315
|
+
return []
|
|
316
|
+
|
|
317
|
+
indexes = []
|
|
318
|
+
for dynamic_block_index in variable.storage.listdir(variable.variable_dir_path):
|
|
319
|
+
index_path = os.path.join(variable.variable_dir_path, dynamic_block_index)
|
|
320
|
+
if dynamic_block_index.isdigit() and variable.storage.isdir(index_path):
|
|
321
|
+
output_path = os.path.join(index_path, variable.uuid)
|
|
322
|
+
if variable.storage.isdir(output_path):
|
|
323
|
+
indexes.append((int(dynamic_block_index), index_path, output_path))
|
|
324
|
+
|
|
325
|
+
return indexes
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
def __get_part_uuids(variable, path: str) -> Optional[List[str]]:
|
|
329
|
+
part_uuids = None
|
|
330
|
+
for chunk_uuid in variable.storage.listdir(path):
|
|
331
|
+
if chunk_uuid.isdigit() and variable.storage.isdir(os.path.join(path, chunk_uuid)):
|
|
332
|
+
if part_uuids is None:
|
|
333
|
+
part_uuids = []
|
|
334
|
+
part_uuids.append(chunk_uuid)
|
|
335
|
+
|
|
336
|
+
return part_uuids
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from typing import Any, List, Optional, Tuple, Union
|
|
3
|
+
|
|
4
|
+
from mage_ai.data_preparation.models.interfaces import VariableInterface
|
|
5
|
+
from mage_ai.shared.array import find
|
|
6
|
+
from mage_ai.shared.strings import to_ordinal_integers
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def __sort(text) -> Tuple[int, int]:
|
|
10
|
+
number = re.findall('\\d+', text)
|
|
11
|
+
if number:
|
|
12
|
+
if len(number) == 1:
|
|
13
|
+
number.append(0)
|
|
14
|
+
number = number[:2]
|
|
15
|
+
else:
|
|
16
|
+
number = to_ordinal_integers(text)
|
|
17
|
+
|
|
18
|
+
number = [int(i) for i in number][:2]
|
|
19
|
+
return tuple(number)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def __sort_object(variable: VariableInterface) -> Tuple[int, int]:
|
|
23
|
+
return __sort(variable.uuid)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def sort_variable_uuids(variable_uuids: List[str]) -> List[str]:
|
|
27
|
+
return sorted(variable_uuids, key=__sort)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def sort_variables(variables: List[VariableInterface]) -> List[VariableInterface]:
|
|
31
|
+
return sorted(variables, key=__sort_object)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def is_output_variable(variable_uuid: str, include_df: bool = True) -> bool:
|
|
35
|
+
"""
|
|
36
|
+
Checks if the given variable UUID represents an output variable.
|
|
37
|
+
|
|
38
|
+
`df` variable is only used to save the sample Spark dataframe now.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
variable_uuid (str): The UUID of the variable.
|
|
42
|
+
include_df (bool): Whether to include the `df` variable. Only set it to True
|
|
43
|
+
when saving or fetching sample Spark dataframe.
|
|
44
|
+
|
|
45
|
+
Returns:
|
|
46
|
+
bool: True if the variable is an output variable, False otherwise.
|
|
47
|
+
|
|
48
|
+
"""
|
|
49
|
+
return (include_df and variable_uuid == 'df') or variable_uuid.startswith('output')
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def variable_priority(variable_uuid: str) -> Optional[int]:
|
|
53
|
+
number = re.findall('\\d+', variable_uuid)[:1]
|
|
54
|
+
if number:
|
|
55
|
+
number = number[0]
|
|
56
|
+
if number.isdigit():
|
|
57
|
+
return int(number)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def get_first_data_output_variable(
|
|
61
|
+
variables: List[Union[VariableInterface, Any]],
|
|
62
|
+
) -> Optional[Union[VariableInterface, Any]]:
|
|
63
|
+
return find(
|
|
64
|
+
lambda variable: is_output_variable(variable.uuid)
|
|
65
|
+
and variable_priority(variable.uuid) == 0,
|
|
66
|
+
sort_variables(variables),
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def get_first_data_output_variable_uuid(
|
|
71
|
+
variables: List[str],
|
|
72
|
+
) -> Optional[str]:
|
|
73
|
+
return find(
|
|
74
|
+
lambda variable_uuid: is_output_variable(variable_uuid)
|
|
75
|
+
and variable_priority(variable_uuid) == 0,
|
|
76
|
+
sort_variable_uuids(variables),
|
|
77
|
+
)
|