mage-ai 0.9.69__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/BackfillPolicy.py +1 -0
- 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 -137
- mage_ai/api/policies/WorkspacePolicy.py +1 -0
- mage_ai/api/presenters/BackfillPresenter.py +1 -0
- 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 +101 -31
- mage_ai/api/resources/GitCustomBranchResource.py +29 -1
- 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/OauthResource.py +1 -1
- 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 +258 -125
- mage_ai/api/resources/PipelineRunResource.py +52 -7
- mage_ai/api/resources/PipelineScheduleResource.py +11 -2
- mage_ai/api/resources/PipelineTriggerResource.py +6 -1
- mage_ai/api/resources/ProjectResource.py +18 -7
- mage_ai/api/resources/PullRequestResource.py +6 -4
- 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 +6 -5
- 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 +33 -5
- 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/kubernetes/workload_manager.py +52 -1
- mage_ai/cluster_manager/manage.py +1 -1
- mage_ai/cluster_manager/workspace/base.py +7 -1
- mage_ai/cluster_manager/workspace/kubernetes.py +22 -1
- mage_ai/command_center/applications/factory.py +10 -7
- mage_ai/command_center/applications/utils.py +2 -2
- mage_ai/command_center/files/factory.py +17 -15
- mage_ai/command_center/presenters/text.py +1 -1
- 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/k8s_block_executor.py +30 -7
- mage_ai/data_preparation/executors/k8s_pipeline_executor.py +30 -7
- mage_ai/data_preparation/executors/streaming_pipeline_executor.py +2 -2
- mage_ai/data_preparation/git/__init__.py +77 -29
- mage_ai/data_preparation/git/api.py +69 -8
- mage_ai/data_preparation/git/utils.py +64 -34
- mage_ai/data_preparation/logging/logger_manager.py +4 -3
- mage_ai/data_preparation/models/block/__init__.py +1562 -879
- 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 +295 -167
- 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 +35 -3
- 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/remote/__init__.py +0 -0
- mage_ai/data_preparation/models/block/remote/models.py +58 -0
- 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 +164 -69
- mage_ai/data_preparation/models/constants.py +21 -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 +100 -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 +374 -185
- 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 +124 -26
- 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 +18 -9
- 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/migrations/versions/42a14d6143f1_update_token_column_type.py +54 -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 +12 -18
- mage_ai/orchestration/db/models/projects.py +10 -0
- mage_ai/orchestration/db/models/schedules.py +225 -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 +38 -15
- mage_ai/orchestration/pipeline_scheduler_original.py +64 -33
- 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 +41 -2
- mage_ai/orchestration/triggers/global_data_product.py +9 -4
- mage_ai/orchestration/triggers/utils.py +10 -1
- mage_ai/orchestration/utils/resources.py +3 -0
- 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 +9 -2
- mage_ai/server/api/runs.py +151 -0
- mage_ai/server/api/triggers.py +3 -1
- mage_ai/server/constants.py +1 -1
- mage_ai/server/frontend_dist/404.html +8 -8
- 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-25a7d985d5564fd3.js +1 -0
- 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/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/{3763-61b542dafdbf5754.js → 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/9624-8b8e100079ab69e1.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/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/{overview-597b74828bf105db.js → overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/{frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7e737f6fc7e83e9b.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- 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/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- mage_ai/server/frontend_dist/_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-b603d7fe4b175256.js +1 -0
- 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/{triggers-9cba3211434a8966.js → triggers-a599c6ac89be8c8d.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 +15 -15
- 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 +8 -8
- 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-25a7d985d5564fd3.js +1 -0
- 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_base_path_template/_next/static/chunks/{3548-fa0792ddb88f4646.js → 3548-9d26185b3fb663b1.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/{3763-61b542dafdbf5754.js → 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/9624-8b8e100079ab69e1.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_base_path_template/_next/static/chunks/pages/manage-4bfc84ff07d7656f.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/{overview-597b74828bf105db.js → overview-9f1ac4ec003884f3.js} +1 -1
- mage_ai/server/{frontend_dist/_next/static/chunks/pages/pipeline-runs-3edc6270c5b0e962.js → frontend_dist_base_path_template/_next/static/chunks/pages/pipeline-runs-6d183f91a2ff6668.js} +1 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-7e737f6fc7e83e9b.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-38e1fbcfbfc1014e.js +1 -0
- 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/pipelines/[pipeline]/triggers/[...slug]-eb11c5390c982b49.js +1 -0
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/{triggers-1bdfda8edc9cf4a8.js → triggers-4612d15a65c35912.js} +1 -1
- 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_base_path_template/_next/static/chunks/pages/settings/platform/preferences-b603d7fe4b175256.js +1 -0
- 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/{triggers-9cba3211434a8966.js → triggers-a599c6ac89be8c8d.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 +15 -15
- 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 +12 -1
- mage_ai/server/server.py +69 -42
- 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/aws/ecs/ecs.py +1 -0
- mage_ai/services/k8s/config.py +27 -4
- mage_ai/services/k8s/job_manager.py +6 -1
- mage_ai/services/k8s/utils.py +97 -0
- 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 +144 -13
- 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/mixins.py +1 -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 +11 -4
- mage_ai/tests/authentication/oauth/test_utils.py +1 -1
- 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 +5 -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 +141 -138
- mage_ai/tests/orchestration/triggers/test_utils.py +3 -2
- mage_ai/tests/server/test_server.py +19 -0
- mage_ai/tests/services/k8s/test_job_manager.py +27 -6
- 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/version_control/branch/utils.py +2 -1
- mage_ai/version_control/models.py +3 -2
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/METADATA +6 -3
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/RECORD +555 -454
- mage_ai/data_preparation/models/global_data_product/constants.py +0 -6
- mage_ai/server/frontend_dist/_next/static/_krrrgup_C-dPOpX36S8I/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/1557-df144fbd8b2208c3.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-f07b2913f7326b50.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/9624-59b2f803f9c88cd6.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-d9c89527266296f7.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/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.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-e1dd1ed71d26c10d.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/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.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-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/KLL5mirre9d7_ZeEpaw3s/_buildManifest.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/1557-df144fbd8b2208c3.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-f07b2913f7326b50.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/9624-59b2f803f9c88cd6.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-d9c89527266296f7.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/manage-852d403c7bda21b3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills/[...slug]-ff4bd7a8ec3bab40.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/pipelines/[pipeline]/backfills-a8b61d8d239fd16f.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-e1dd1ed71d26c10d.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/pipelines/[pipeline]/triggers/[...slug]-f028ef3880ed856c.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/platform/preferences-503049734a8b082f.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/settings/workspace/preferences-5b26eeda8aed8a7b.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-8b793b3b696a2cd3.js +0 -1
- mage_ai/server/frontend_dist_base_path_template/_next/static/chunks/pages/version-control-5753fac7c1bfdc88.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/{_krrrgup_C-dPOpX36S8I → UZLabyPgcxtZvp0O0EUUS}/_ssgManifest.js +0 -0
- /mage_ai/server/frontend_dist_base_path_template/_next/static/{KLL5mirre9d7_ZeEpaw3s → kcptwoOU-JJJg6Vwpkfmx}/_ssgManifest.js +0 -0
- /mage_ai/tests/data_preparation/{shared → storage/shared}/test_secrets.py +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/LICENSE +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/WHEEL +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/entry_points.txt +0 -0
- {mage_ai-0.9.69.dist-info → mage_ai-0.9.71.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import os
|
|
3
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
4
|
+
|
|
5
|
+
import pandas as pd
|
|
6
|
+
import polars as pl
|
|
7
|
+
import simplejson
|
|
8
|
+
from sklearn.utils import estimator_html_repr
|
|
9
|
+
|
|
10
|
+
from mage_ai.ai.utils.xgboost import render_tree_visualization
|
|
11
|
+
from mage_ai.data.constants import InputDataType
|
|
12
|
+
from mage_ai.data.models.constants import CHUNKS_DIRECTORY_NAME
|
|
13
|
+
from mage_ai.data.tabular.models import BatchSettings
|
|
14
|
+
from mage_ai.data.tabular.reader import read_metadata
|
|
15
|
+
from mage_ai.data.tabular.utils import (
|
|
16
|
+
convert_series_list_to_dataframe,
|
|
17
|
+
series_to_dataframe,
|
|
18
|
+
)
|
|
19
|
+
from mage_ai.data_cleaner.shared.utils import is_geo_dataframe, is_spark_dataframe
|
|
20
|
+
from mage_ai.data_preparation.models.block.dynamic.utils import (
|
|
21
|
+
is_dynamic_block,
|
|
22
|
+
is_dynamic_block_child,
|
|
23
|
+
)
|
|
24
|
+
from mage_ai.data_preparation.models.block.settings.variables.models import (
|
|
25
|
+
ChunkKeyTypeUnion,
|
|
26
|
+
)
|
|
27
|
+
from mage_ai.data_preparation.models.constants import (
|
|
28
|
+
DATAFRAME_ANALYSIS_MAX_COLUMNS,
|
|
29
|
+
DATAFRAME_SAMPLE_COUNT,
|
|
30
|
+
DATAFRAME_SAMPLE_COUNT_PREVIEW,
|
|
31
|
+
)
|
|
32
|
+
from mage_ai.data_preparation.models.utils import (
|
|
33
|
+
infer_variable_type,
|
|
34
|
+
is_basic_iterable,
|
|
35
|
+
is_primitive,
|
|
36
|
+
)
|
|
37
|
+
from mage_ai.data_preparation.models.variables.constants import VariableType
|
|
38
|
+
from mage_ai.server.kernel_output_parser import DataType
|
|
39
|
+
from mage_ai.settings.server import MEMORY_MANAGER_V2
|
|
40
|
+
from mage_ai.shared.hash import merge_dict
|
|
41
|
+
from mage_ai.shared.parsers import (
|
|
42
|
+
convert_matrix_to_dataframe,
|
|
43
|
+
encode_complex,
|
|
44
|
+
has_to_dict,
|
|
45
|
+
)
|
|
46
|
+
from mage_ai.shared.strings import is_json
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def format_output_data(
|
|
50
|
+
block,
|
|
51
|
+
data: Any,
|
|
52
|
+
variable_uuid: str,
|
|
53
|
+
block_uuid: Optional[str] = None,
|
|
54
|
+
csv_lines_only: Optional[bool] = False,
|
|
55
|
+
execution_partition: Optional[str] = None,
|
|
56
|
+
index: Optional[int] = None,
|
|
57
|
+
skip_dynamic_block: bool = False,
|
|
58
|
+
automatic_sampling: bool = False,
|
|
59
|
+
sample_count: Optional[int] = None,
|
|
60
|
+
) -> Tuple[Dict, bool]:
|
|
61
|
+
"""
|
|
62
|
+
Takes variable data and formats it to return to the frontend.
|
|
63
|
+
|
|
64
|
+
Returns:
|
|
65
|
+
Tuple[Dict, bool]: Tuple of the formatted data and is_data_product boolean. Data product
|
|
66
|
+
outputs and non data product outputs are handled slightly differently.
|
|
67
|
+
"""
|
|
68
|
+
if not block_uuid:
|
|
69
|
+
block_uuid = block.uuid
|
|
70
|
+
|
|
71
|
+
variable_type, basic_iterable = infer_variable_type(data)
|
|
72
|
+
|
|
73
|
+
variable_manager = block.pipeline.variable_manager
|
|
74
|
+
|
|
75
|
+
is_dynamic_child = is_dynamic_block_child(block)
|
|
76
|
+
is_dynamic = is_dynamic_block(block)
|
|
77
|
+
|
|
78
|
+
if (
|
|
79
|
+
variable_type in [VariableType.DATAFRAME, VariableType.POLARS_DATAFRAME]
|
|
80
|
+
and is_basic_iterable
|
|
81
|
+
and isinstance(data, list)
|
|
82
|
+
and not is_dynamic
|
|
83
|
+
):
|
|
84
|
+
formatted_outputs = []
|
|
85
|
+
for output_idx, output in enumerate(data):
|
|
86
|
+
output_formatted, _ = format_output_data(
|
|
87
|
+
block,
|
|
88
|
+
output,
|
|
89
|
+
os.path.join(variable_uuid, str(output_idx)),
|
|
90
|
+
automatic_sampling=automatic_sampling,
|
|
91
|
+
block_uuid=block_uuid,
|
|
92
|
+
csv_lines_only=csv_lines_only,
|
|
93
|
+
execution_partition=execution_partition,
|
|
94
|
+
index=index,
|
|
95
|
+
sample_count=sample_count,
|
|
96
|
+
skip_dynamic_block=skip_dynamic_block,
|
|
97
|
+
)
|
|
98
|
+
formatted_outputs.append(output_formatted)
|
|
99
|
+
|
|
100
|
+
return dict(
|
|
101
|
+
outputs=formatted_outputs,
|
|
102
|
+
type=DataType.GROUP,
|
|
103
|
+
variable_uuid=variable_uuid,
|
|
104
|
+
), True
|
|
105
|
+
elif VariableType.SERIES_PANDAS == variable_type:
|
|
106
|
+
if automatic_sampling and not sample_count:
|
|
107
|
+
sample_count = min(len(data), DATAFRAME_SAMPLE_COUNT)
|
|
108
|
+
if basic_iterable:
|
|
109
|
+
data = pd.DataFrame(data).T
|
|
110
|
+
else:
|
|
111
|
+
data = data.to_frame()
|
|
112
|
+
elif VariableType.SERIES_POLARS == variable_type:
|
|
113
|
+
if automatic_sampling and not sample_count:
|
|
114
|
+
sample_count = min(len(data), DATAFRAME_SAMPLE_COUNT)
|
|
115
|
+
if basic_iterable:
|
|
116
|
+
data = convert_series_list_to_dataframe(data)
|
|
117
|
+
else:
|
|
118
|
+
data = series_to_dataframe(data)
|
|
119
|
+
elif VariableType.ITERABLE == variable_type and isinstance(data, list):
|
|
120
|
+
data = pd.Series(data).to_frame()
|
|
121
|
+
|
|
122
|
+
if VariableType.MATRIX_SPARSE == variable_type:
|
|
123
|
+
if automatic_sampling and not sample_count:
|
|
124
|
+
n_rows, n_cols = data.shape
|
|
125
|
+
max_dims = min(
|
|
126
|
+
DATAFRAME_ANALYSIS_MAX_COLUMNS * DATAFRAME_SAMPLE_COUNT, n_rows * n_cols
|
|
127
|
+
)
|
|
128
|
+
sample_count = round(max_dims / n_cols)
|
|
129
|
+
if basic_iterable:
|
|
130
|
+
data = convert_matrix_to_dataframe(data[0])
|
|
131
|
+
else:
|
|
132
|
+
data = convert_matrix_to_dataframe(data)
|
|
133
|
+
|
|
134
|
+
return format_output_data(
|
|
135
|
+
block,
|
|
136
|
+
data,
|
|
137
|
+
variable_uuid=variable_uuid,
|
|
138
|
+
block_uuid=block_uuid,
|
|
139
|
+
csv_lines_only=csv_lines_only,
|
|
140
|
+
execution_partition=execution_partition,
|
|
141
|
+
skip_dynamic_block=skip_dynamic_block,
|
|
142
|
+
automatic_sampling=automatic_sampling,
|
|
143
|
+
index=index,
|
|
144
|
+
sample_count=sample_count,
|
|
145
|
+
)
|
|
146
|
+
elif VariableType.CUSTOM_OBJECT == variable_type:
|
|
147
|
+
return_output = dict(
|
|
148
|
+
text_data=encode_complex(data),
|
|
149
|
+
variable_uuid=variable_uuid,
|
|
150
|
+
)
|
|
151
|
+
if has_to_dict(data):
|
|
152
|
+
return_output['type'] = DataType.OBJECT
|
|
153
|
+
else:
|
|
154
|
+
return_output['type'] = DataType.TEXT
|
|
155
|
+
|
|
156
|
+
return return_output, True
|
|
157
|
+
elif (
|
|
158
|
+
VariableType.MODEL_SKLEARN == variable_type or VariableType.MODEL_XGBOOST == variable_type
|
|
159
|
+
):
|
|
160
|
+
|
|
161
|
+
def __render(
|
|
162
|
+
model: Any,
|
|
163
|
+
partition=execution_partition,
|
|
164
|
+
pipeline=block.pipeline,
|
|
165
|
+
uuid=block.uuid,
|
|
166
|
+
variable_manager=variable_manager,
|
|
167
|
+
variable_type=variable_type,
|
|
168
|
+
variable_uuid=variable_uuid,
|
|
169
|
+
) -> Dict[str, Optional[str]]:
|
|
170
|
+
data_type = None
|
|
171
|
+
text_data = None
|
|
172
|
+
|
|
173
|
+
if VariableType.MODEL_SKLEARN == variable_type:
|
|
174
|
+
data_type = DataType.TEXT_HTML
|
|
175
|
+
text_data = estimator_html_repr(model)
|
|
176
|
+
elif variable_manager:
|
|
177
|
+
image_dir = variable_manager.build_variable(
|
|
178
|
+
pipeline_uuid=pipeline.uuid if pipeline.uuid else None,
|
|
179
|
+
block_uuid=uuid,
|
|
180
|
+
variable_uuid=variable_uuid,
|
|
181
|
+
partition=partition,
|
|
182
|
+
variable_type=variable_type,
|
|
183
|
+
).variable_path
|
|
184
|
+
text_data, success = render_tree_visualization(image_dir)
|
|
185
|
+
|
|
186
|
+
if success:
|
|
187
|
+
data_type = DataType.IMAGE_PNG
|
|
188
|
+
else:
|
|
189
|
+
data_type = DataType.TEXT
|
|
190
|
+
|
|
191
|
+
return dict(
|
|
192
|
+
text_data=text_data,
|
|
193
|
+
type=data_type,
|
|
194
|
+
variable_uuid=variable_uuid,
|
|
195
|
+
)
|
|
196
|
+
|
|
197
|
+
if not basic_iterable:
|
|
198
|
+
return __render(data), True
|
|
199
|
+
|
|
200
|
+
data = dict(
|
|
201
|
+
text_data=simplejson.dumps(
|
|
202
|
+
[__render(d) for d in data],
|
|
203
|
+
default=encode_complex,
|
|
204
|
+
ignore_nan=True,
|
|
205
|
+
),
|
|
206
|
+
type=DataType.TEXT,
|
|
207
|
+
variable_uuid=variable_uuid,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
return data, True
|
|
211
|
+
elif (is_dynamic_child or is_dynamic) and not skip_dynamic_block:
|
|
212
|
+
from mage_ai.data_preparation.models.block.dynamic.utils import (
|
|
213
|
+
coerce_into_dataframe,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
if VariableType.LIST_COMPLEX == variable_type and basic_iterable and len(data) >= 1:
|
|
217
|
+
data = [encode_complex(item) for item in data]
|
|
218
|
+
|
|
219
|
+
return format_output_data(
|
|
220
|
+
block,
|
|
221
|
+
data=coerce_into_dataframe(
|
|
222
|
+
data,
|
|
223
|
+
is_dynamic=is_dynamic,
|
|
224
|
+
is_dynamic_child=is_dynamic_child,
|
|
225
|
+
),
|
|
226
|
+
automatic_sampling=automatic_sampling,
|
|
227
|
+
execution_partition=execution_partition,
|
|
228
|
+
index=index,
|
|
229
|
+
sample_count=sample_count,
|
|
230
|
+
skip_dynamic_block=True,
|
|
231
|
+
variable_uuid=variable_uuid,
|
|
232
|
+
)
|
|
233
|
+
elif isinstance(data, pd.DataFrame):
|
|
234
|
+
if csv_lines_only:
|
|
235
|
+
data = dict(table=data.to_csv(header=True, index=False).strip('\n').split('\n'))
|
|
236
|
+
else:
|
|
237
|
+
try:
|
|
238
|
+
analysis = block.get_analysis(
|
|
239
|
+
block_uuid=block_uuid,
|
|
240
|
+
index=index,
|
|
241
|
+
partition=execution_partition,
|
|
242
|
+
variable_uuid=variable_uuid,
|
|
243
|
+
)
|
|
244
|
+
except Exception as err:
|
|
245
|
+
print(f'Error getting dataframe analysis for block {block_uuid}: {err}')
|
|
246
|
+
analysis = None
|
|
247
|
+
|
|
248
|
+
if analysis is not None and (analysis.get('statistics') or analysis.get('metadata')):
|
|
249
|
+
stats = analysis.get('statistics', {})
|
|
250
|
+
column_types = (analysis.get('metadata') or {}).get('column_types', {})
|
|
251
|
+
row_count = stats.get('original_row_count', stats.get('count'))
|
|
252
|
+
column_count = stats.get('original_column_count', len(column_types))
|
|
253
|
+
else:
|
|
254
|
+
row_count, column_count = data.shape
|
|
255
|
+
|
|
256
|
+
columns_to_display = data.columns.tolist()[:DATAFRAME_ANALYSIS_MAX_COLUMNS]
|
|
257
|
+
|
|
258
|
+
if automatic_sampling and not sample_count:
|
|
259
|
+
data = data.iloc[:DATAFRAME_SAMPLE_COUNT]
|
|
260
|
+
elif sample_count:
|
|
261
|
+
data = data.iloc[:sample_count]
|
|
262
|
+
|
|
263
|
+
data = dict(
|
|
264
|
+
sample_data=dict(
|
|
265
|
+
columns=columns_to_display,
|
|
266
|
+
rows=json.loads(
|
|
267
|
+
data[columns_to_display].to_json(orient='split', date_format='iso'),
|
|
268
|
+
)['data'],
|
|
269
|
+
),
|
|
270
|
+
shape=[row_count, column_count],
|
|
271
|
+
type=DataType.TABLE,
|
|
272
|
+
variable_uuid=variable_uuid,
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
if MEMORY_MANAGER_V2:
|
|
276
|
+
data['resource_usage'] = block.get_resource_usage(
|
|
277
|
+
block_uuid=block_uuid,
|
|
278
|
+
partition=execution_partition,
|
|
279
|
+
variable_uuid=variable_uuid,
|
|
280
|
+
index=index,
|
|
281
|
+
)
|
|
282
|
+
|
|
283
|
+
return data, True
|
|
284
|
+
elif isinstance(data, pl.DataFrame):
|
|
285
|
+
try:
|
|
286
|
+
analysis = block.get_analysis(
|
|
287
|
+
block_uuid=block_uuid,
|
|
288
|
+
index=index,
|
|
289
|
+
partition=execution_partition,
|
|
290
|
+
variable_uuid=variable_uuid,
|
|
291
|
+
)
|
|
292
|
+
except Exception as err:
|
|
293
|
+
raise err
|
|
294
|
+
analysis = None
|
|
295
|
+
if analysis is not None:
|
|
296
|
+
stats = analysis.get('statistics', {})
|
|
297
|
+
row_count = stats.get('original_row_count')
|
|
298
|
+
column_count = stats.get('original_column_count')
|
|
299
|
+
else:
|
|
300
|
+
row_count, column_count = data.shape
|
|
301
|
+
|
|
302
|
+
columns_to_display = data.columns[:DATAFRAME_ANALYSIS_MAX_COLUMNS]
|
|
303
|
+
sample_count = sample_count or DATAFRAME_SAMPLE_COUNT_PREVIEW
|
|
304
|
+
resource_usage = None
|
|
305
|
+
|
|
306
|
+
if MEMORY_MANAGER_V2:
|
|
307
|
+
variable = block.get_variable_object(
|
|
308
|
+
block_uuid=block_uuid,
|
|
309
|
+
variable_uuid=variable_uuid,
|
|
310
|
+
partition=execution_partition,
|
|
311
|
+
)
|
|
312
|
+
|
|
313
|
+
metadata = read_metadata(
|
|
314
|
+
os.path.join(
|
|
315
|
+
variable.variable_dir_path,
|
|
316
|
+
variable_uuid,
|
|
317
|
+
str(index) if index is not None else '',
|
|
318
|
+
CHUNKS_DIRECTORY_NAME,
|
|
319
|
+
),
|
|
320
|
+
include_schema=True,
|
|
321
|
+
)
|
|
322
|
+
if metadata:
|
|
323
|
+
try:
|
|
324
|
+
row_count = metadata.get('num_rows') or row_count
|
|
325
|
+
schema = metadata.get('schema')
|
|
326
|
+
if schema and isinstance(schema, dict):
|
|
327
|
+
column_count = len(schema) or column_count
|
|
328
|
+
except ValueError:
|
|
329
|
+
pass
|
|
330
|
+
|
|
331
|
+
if sample_count is not None:
|
|
332
|
+
data = data[:sample_count]
|
|
333
|
+
|
|
334
|
+
resource_usage = block.get_resource_usage(
|
|
335
|
+
block_uuid=block_uuid,
|
|
336
|
+
partition=execution_partition,
|
|
337
|
+
variable_uuid=variable_uuid,
|
|
338
|
+
index=index,
|
|
339
|
+
)
|
|
340
|
+
|
|
341
|
+
data = dict(
|
|
342
|
+
sample_data=dict(
|
|
343
|
+
columns=columns_to_display,
|
|
344
|
+
rows=[
|
|
345
|
+
list(row.values())
|
|
346
|
+
for row in json.loads(data[columns_to_display].write_json(row_oriented=True))
|
|
347
|
+
],
|
|
348
|
+
),
|
|
349
|
+
resource_usage=resource_usage,
|
|
350
|
+
shape=[row_count, column_count],
|
|
351
|
+
type=DataType.TABLE,
|
|
352
|
+
variable_uuid=variable_uuid,
|
|
353
|
+
)
|
|
354
|
+
return data, True
|
|
355
|
+
elif is_geo_dataframe(data):
|
|
356
|
+
data = dict(
|
|
357
|
+
text_data=f"""Use the code in a scratchpad to get the output of the block:
|
|
358
|
+
|
|
359
|
+
from mage_ai.data_preparation.variable_manager import get_variable
|
|
360
|
+
df = get_variable('{block.pipeline.uuid}', '{block.uuid}', 'df')
|
|
361
|
+
""",
|
|
362
|
+
type=DataType.TEXT,
|
|
363
|
+
variable_uuid=variable_uuid,
|
|
364
|
+
)
|
|
365
|
+
return data, False
|
|
366
|
+
elif is_primitive(data):
|
|
367
|
+
json_data = is_json(data)
|
|
368
|
+
if json_data:
|
|
369
|
+
text_data = json_data.get('data') or ''
|
|
370
|
+
if isinstance(text_data, list):
|
|
371
|
+
text_data = '\n'.join(text_data)
|
|
372
|
+
data = dict(
|
|
373
|
+
text_data=text_data,
|
|
374
|
+
type=DataType.TEXT_PLAIN,
|
|
375
|
+
variable_uuid=variable_uuid,
|
|
376
|
+
)
|
|
377
|
+
else:
|
|
378
|
+
data = dict(
|
|
379
|
+
text_data=str(data),
|
|
380
|
+
type=DataType.TEXT,
|
|
381
|
+
variable_uuid=variable_uuid,
|
|
382
|
+
)
|
|
383
|
+
return data, False
|
|
384
|
+
elif basic_iterable:
|
|
385
|
+
data = dict(
|
|
386
|
+
text_data=simplejson.dumps(
|
|
387
|
+
data,
|
|
388
|
+
default=encode_complex,
|
|
389
|
+
ignore_nan=True,
|
|
390
|
+
),
|
|
391
|
+
type=DataType.TEXT,
|
|
392
|
+
variable_uuid=variable_uuid,
|
|
393
|
+
)
|
|
394
|
+
return data, False
|
|
395
|
+
elif isinstance(data, dict):
|
|
396
|
+
try:
|
|
397
|
+
pair = format_output_data(
|
|
398
|
+
block,
|
|
399
|
+
pd.DataFrame([data]),
|
|
400
|
+
variable_uuid=variable_uuid,
|
|
401
|
+
block_uuid=block_uuid,
|
|
402
|
+
csv_lines_only=csv_lines_only,
|
|
403
|
+
execution_partition=execution_partition,
|
|
404
|
+
skip_dynamic_block=skip_dynamic_block,
|
|
405
|
+
automatic_sampling=automatic_sampling,
|
|
406
|
+
sample_count=sample_count,
|
|
407
|
+
)
|
|
408
|
+
if len(pair) >= 1:
|
|
409
|
+
return pair[0], True
|
|
410
|
+
except Exception as err:
|
|
411
|
+
print(
|
|
412
|
+
f'[ERROR] Block.format_output_data for block '
|
|
413
|
+
f'{block.uuid} variable {variable_uuid}: {err}',
|
|
414
|
+
)
|
|
415
|
+
|
|
416
|
+
data = dict(
|
|
417
|
+
text_data=simplejson.dumps(
|
|
418
|
+
data,
|
|
419
|
+
default=encode_complex,
|
|
420
|
+
ignore_nan=True,
|
|
421
|
+
),
|
|
422
|
+
type=DataType.TEXT,
|
|
423
|
+
variable_uuid=variable_uuid,
|
|
424
|
+
)
|
|
425
|
+
return data, False
|
|
426
|
+
elif is_spark_dataframe(data):
|
|
427
|
+
df = data.toPandas()
|
|
428
|
+
columns_to_display = df.columns.tolist()[:DATAFRAME_ANALYSIS_MAX_COLUMNS]
|
|
429
|
+
data = dict(
|
|
430
|
+
sample_data=dict(
|
|
431
|
+
columns=columns_to_display,
|
|
432
|
+
rows=json.loads(
|
|
433
|
+
df[columns_to_display].to_json(orient='split', date_format='iso'),
|
|
434
|
+
)['data'],
|
|
435
|
+
),
|
|
436
|
+
type=DataType.TABLE,
|
|
437
|
+
variable_uuid=variable_uuid,
|
|
438
|
+
)
|
|
439
|
+
return data, True
|
|
440
|
+
|
|
441
|
+
return data, False
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
def get_outputs_for_display_dynamic_block(
|
|
445
|
+
block,
|
|
446
|
+
output_sets: List[Tuple],
|
|
447
|
+
child_data_sets: List[Tuple[Any, Any]],
|
|
448
|
+
block_uuid: Optional[str] = None,
|
|
449
|
+
csv_lines_only: bool = False,
|
|
450
|
+
dynamic_block_index: Optional[int] = None,
|
|
451
|
+
exclude_blank_variable_uuids: bool = False,
|
|
452
|
+
execution_partition: Optional[str] = None,
|
|
453
|
+
metadata: Optional[Dict] = None,
|
|
454
|
+
sample: bool = True,
|
|
455
|
+
sample_count: Optional[int] = None,
|
|
456
|
+
) -> List[Dict[str, Any]]:
|
|
457
|
+
data_products = []
|
|
458
|
+
outputs = []
|
|
459
|
+
block_uuid = block_uuid if block_uuid else block.uuid
|
|
460
|
+
|
|
461
|
+
for idx, pairs in enumerate(child_data_sets):
|
|
462
|
+
child_data, metadata = pairs
|
|
463
|
+
formatted_outputs = []
|
|
464
|
+
|
|
465
|
+
if child_data is not None and isinstance(child_data, list) and len(child_data) >= 1:
|
|
466
|
+
for output_idx, output in enumerate(child_data):
|
|
467
|
+
output_formatted, _ = format_output_data(
|
|
468
|
+
block,
|
|
469
|
+
output,
|
|
470
|
+
f'output_{output_idx}',
|
|
471
|
+
block_uuid=block_uuid,
|
|
472
|
+
csv_lines_only=csv_lines_only,
|
|
473
|
+
execution_partition=execution_partition,
|
|
474
|
+
index=output_idx,
|
|
475
|
+
sample_count=sample_count // len(child_data)
|
|
476
|
+
if sample_count is not None
|
|
477
|
+
else None,
|
|
478
|
+
)
|
|
479
|
+
formatted_outputs.append(output_formatted)
|
|
480
|
+
|
|
481
|
+
# Override this with dynamic_block_index because execute_code_output from the IDE
|
|
482
|
+
# runs each dynamic child block asynchronously and prints the output immediately.
|
|
483
|
+
var_uuid = (
|
|
484
|
+
f'Dynamic child {dynamic_block_index if dynamic_block_index is not None else idx}'
|
|
485
|
+
)
|
|
486
|
+
data_products.append(
|
|
487
|
+
dict(
|
|
488
|
+
outputs=formatted_outputs,
|
|
489
|
+
type=DataType.GROUP,
|
|
490
|
+
variable_uuid=var_uuid,
|
|
491
|
+
)
|
|
492
|
+
)
|
|
493
|
+
else:
|
|
494
|
+
output_sets.append((child_data, metadata))
|
|
495
|
+
|
|
496
|
+
for output_pair in output_sets:
|
|
497
|
+
child_data = None
|
|
498
|
+
metadata = None
|
|
499
|
+
if len(output_pair) >= 1:
|
|
500
|
+
child_data = output_pair[0]
|
|
501
|
+
if len(output_pair) >= 2:
|
|
502
|
+
metadata = output_pair[1]
|
|
503
|
+
|
|
504
|
+
for output, variable_uuid in [
|
|
505
|
+
(child_data, 'output_0'),
|
|
506
|
+
(metadata, 'output_1'),
|
|
507
|
+
]:
|
|
508
|
+
if output is None or (exclude_blank_variable_uuids and variable_uuid.strip() == ''):
|
|
509
|
+
continue
|
|
510
|
+
|
|
511
|
+
variable_type, basic_iterable = infer_variable_type(output)
|
|
512
|
+
if (
|
|
513
|
+
variable_type in [VariableType.DATAFRAME, VariableType.POLARS_DATAFRAME]
|
|
514
|
+
and is_basic_iterable
|
|
515
|
+
and isinstance(output, list)
|
|
516
|
+
):
|
|
517
|
+
for output_idx, output_data in enumerate(output):
|
|
518
|
+
output_formatted, _ = format_output_data(
|
|
519
|
+
block,
|
|
520
|
+
output_data,
|
|
521
|
+
variable_uuid,
|
|
522
|
+
block_uuid=block_uuid,
|
|
523
|
+
csv_lines_only=csv_lines_only,
|
|
524
|
+
execution_partition=execution_partition,
|
|
525
|
+
index=output_idx,
|
|
526
|
+
sample_count=sample_count // len(output)
|
|
527
|
+
if sample_count is not None
|
|
528
|
+
else None,
|
|
529
|
+
)
|
|
530
|
+
data_products.append(
|
|
531
|
+
dict(
|
|
532
|
+
outputs=[output_formatted],
|
|
533
|
+
type=DataType.GROUP,
|
|
534
|
+
variable_uuid=os.path.join(variable_uuid, str(output_idx)),
|
|
535
|
+
)
|
|
536
|
+
)
|
|
537
|
+
else:
|
|
538
|
+
data, is_data_product = format_output_data(
|
|
539
|
+
block,
|
|
540
|
+
output,
|
|
541
|
+
variable_uuid,
|
|
542
|
+
block_uuid=block_uuid,
|
|
543
|
+
csv_lines_only=csv_lines_only,
|
|
544
|
+
execution_partition=execution_partition,
|
|
545
|
+
sample_count=sample_count,
|
|
546
|
+
)
|
|
547
|
+
|
|
548
|
+
outputs_below_limit = not sample or not sample_count
|
|
549
|
+
if is_data_product:
|
|
550
|
+
outputs_below_limit = outputs_below_limit or (
|
|
551
|
+
sample_count is not None and len(data_products) < sample_count
|
|
552
|
+
)
|
|
553
|
+
else:
|
|
554
|
+
outputs_below_limit = outputs_below_limit or (
|
|
555
|
+
sample_count is not None and len(outputs) < sample_count
|
|
556
|
+
)
|
|
557
|
+
|
|
558
|
+
if outputs_below_limit:
|
|
559
|
+
data['multi_output'] = True
|
|
560
|
+
if is_data_product:
|
|
561
|
+
data_products.append(data)
|
|
562
|
+
else:
|
|
563
|
+
outputs.append(data)
|
|
564
|
+
|
|
565
|
+
return outputs + data_products
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
def handle_variables(
|
|
569
|
+
block,
|
|
570
|
+
items: List[Dict[str, Any]],
|
|
571
|
+
block_groups: Optional[
|
|
572
|
+
List[Dict[str, Union[List[str], Optional[List[Any]], Optional[str]]]]
|
|
573
|
+
] = None,
|
|
574
|
+
block_uuid: Optional[str] = None,
|
|
575
|
+
csv_lines_only: bool = False,
|
|
576
|
+
exclude_blank_variable_uuids: bool = False,
|
|
577
|
+
execution_partition: Optional[str] = None,
|
|
578
|
+
include_print_outputs: bool = True,
|
|
579
|
+
input_data_types: Optional[List[InputDataType]] = None,
|
|
580
|
+
max_results: Optional[int] = None,
|
|
581
|
+
read_batch_settings: Optional[BatchSettings] = None,
|
|
582
|
+
read_chunks: Optional[List[ChunkKeyTypeUnion]] = None,
|
|
583
|
+
sample: bool = True,
|
|
584
|
+
sample_count: Optional[int] = None,
|
|
585
|
+
selected_variables: Optional[List[str]] = None,
|
|
586
|
+
variable_type: Optional[VariableType] = None,
|
|
587
|
+
):
|
|
588
|
+
data_products = []
|
|
589
|
+
outputs = []
|
|
590
|
+
|
|
591
|
+
all_variables = []
|
|
592
|
+
variable_type_mapping = {}
|
|
593
|
+
|
|
594
|
+
if not block_groups:
|
|
595
|
+
if block.pipeline is None:
|
|
596
|
+
return []
|
|
597
|
+
|
|
598
|
+
if not block_uuid:
|
|
599
|
+
block_uuid = block.uuid
|
|
600
|
+
|
|
601
|
+
all_variables = block.get_variables_by_block(
|
|
602
|
+
block_uuid=block_uuid,
|
|
603
|
+
max_results=max_results,
|
|
604
|
+
partition=execution_partition,
|
|
605
|
+
)
|
|
606
|
+
|
|
607
|
+
if not include_print_outputs:
|
|
608
|
+
all_variables = block.output_variables(
|
|
609
|
+
execution_partition=execution_partition,
|
|
610
|
+
max_results=max_results,
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
block_groups = [dict(block_uuid=block_uuid, variable_uuids=all_variables)]
|
|
614
|
+
|
|
615
|
+
for idx, block_group in enumerate(block_groups):
|
|
616
|
+
b_uuid = block_group['block_uuid']
|
|
617
|
+
variable_uuids = block_group['variable_uuids'] or []
|
|
618
|
+
block_outputs = block_group.get('outputs')
|
|
619
|
+
|
|
620
|
+
for idx_inner, variable_uuid in enumerate(variable_uuids):
|
|
621
|
+
|
|
622
|
+
def __callback(
|
|
623
|
+
data_from_yield,
|
|
624
|
+
b_uuid=b_uuid,
|
|
625
|
+
block=block,
|
|
626
|
+
csv_lines_only=csv_lines_only,
|
|
627
|
+
execution_partition=execution_partition,
|
|
628
|
+
idx=idx,
|
|
629
|
+
idx_inner=idx_inner,
|
|
630
|
+
input_data_types=input_data_types,
|
|
631
|
+
read_batch_settings=read_batch_settings,
|
|
632
|
+
read_chunks=read_chunks,
|
|
633
|
+
variable_uuid=variable_uuid,
|
|
634
|
+
):
|
|
635
|
+
data, is_data_product = format_output_data(
|
|
636
|
+
block,
|
|
637
|
+
data_from_yield,
|
|
638
|
+
variable_uuid,
|
|
639
|
+
block_uuid=b_uuid,
|
|
640
|
+
csv_lines_only=csv_lines_only,
|
|
641
|
+
execution_partition=execution_partition,
|
|
642
|
+
)
|
|
643
|
+
|
|
644
|
+
if is_data_product:
|
|
645
|
+
data_products.append(((idx, idx_inner), data, is_data_product))
|
|
646
|
+
else:
|
|
647
|
+
outputs.append(((idx, idx_inner), data, is_data_product))
|
|
648
|
+
|
|
649
|
+
if (selected_variables and variable_uuid not in selected_variables) or (
|
|
650
|
+
exclude_blank_variable_uuids and variable_uuid.strip() == ''
|
|
651
|
+
):
|
|
652
|
+
continue
|
|
653
|
+
|
|
654
|
+
if block_outputs and idx_inner < len(block_outputs):
|
|
655
|
+
yield (block_outputs[idx_inner], sample, sample_count, __callback)
|
|
656
|
+
else:
|
|
657
|
+
variable_object = block.get_variable_object(
|
|
658
|
+
block_uuid=b_uuid,
|
|
659
|
+
partition=execution_partition,
|
|
660
|
+
variable_uuid=variable_uuid,
|
|
661
|
+
input_data_types=input_data_types,
|
|
662
|
+
read_batch_settings=read_batch_settings,
|
|
663
|
+
read_chunks=read_chunks,
|
|
664
|
+
)
|
|
665
|
+
|
|
666
|
+
if variable_type is not None and variable_object.variable_type != variable_type:
|
|
667
|
+
continue
|
|
668
|
+
|
|
669
|
+
if variable_object.variable_type is not None:
|
|
670
|
+
variable_type_mapping[variable_object.variable_type] = (
|
|
671
|
+
variable_type_mapping.get(variable_object.variable_type, [])
|
|
672
|
+
)
|
|
673
|
+
variable_type_mapping[variable_object.variable_type].append(variable_uuid)
|
|
674
|
+
|
|
675
|
+
yield (variable_object, sample, sample_count, __callback)
|
|
676
|
+
|
|
677
|
+
arr = outputs + data_products
|
|
678
|
+
arr_sorted = sorted(arr, key=lambda x: x[0])
|
|
679
|
+
|
|
680
|
+
if len(data_products) >= len(outputs):
|
|
681
|
+
arr_sorted = [x[1] for x in arr_sorted]
|
|
682
|
+
else:
|
|
683
|
+
arr_sorted = [x[1] for x in arr_sorted]
|
|
684
|
+
|
|
685
|
+
if len(arr_sorted) >= 2 and any([vt for vt in variable_type_mapping.keys()]):
|
|
686
|
+
for item in arr_sorted[:DATAFRAME_SAMPLE_COUNT_PREVIEW]:
|
|
687
|
+
if isinstance(item, dict):
|
|
688
|
+
items.append(merge_dict(item, dict(multi_output=True)))
|
|
689
|
+
else:
|
|
690
|
+
items.append(item)
|
|
691
|
+
else:
|
|
692
|
+
items.extend(arr_sorted)
|
|
693
|
+
|
|
694
|
+
|
|
695
|
+
def get_outputs_for_display_sync(block, **kwargs) -> List[Dict[str, Any]]:
|
|
696
|
+
items = []
|
|
697
|
+
|
|
698
|
+
for outputs in handle_variables(block, items, **kwargs):
|
|
699
|
+
variable_object, sample, sample_count, __callback = outputs
|
|
700
|
+
data = variable_object.read_data(
|
|
701
|
+
sample=sample,
|
|
702
|
+
sample_count=sample_count,
|
|
703
|
+
spark=block.get_spark_session(),
|
|
704
|
+
)
|
|
705
|
+
__callback(data)
|
|
706
|
+
|
|
707
|
+
return items
|
|
708
|
+
|
|
709
|
+
|
|
710
|
+
async def get_outputs_for_display_async(block, **kwargs) -> List[Dict[str, Any]]:
|
|
711
|
+
items = []
|
|
712
|
+
|
|
713
|
+
for outputs in handle_variables(block, items, **kwargs):
|
|
714
|
+
variable_object, sample, sample_count, __callback = outputs
|
|
715
|
+
data = await variable_object.read_data_async(
|
|
716
|
+
sample=sample,
|
|
717
|
+
sample_count=sample_count,
|
|
718
|
+
spark=block.get_spark_session(),
|
|
719
|
+
)
|
|
720
|
+
__callback(data)
|
|
721
|
+
|
|
722
|
+
return items
|