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
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
import asyncio
|
|
2
|
+
import glob
|
|
3
|
+
import json
|
|
4
|
+
from typing import Dict, List, Optional, Union
|
|
5
|
+
|
|
6
|
+
import pandas as pd
|
|
7
|
+
import polars as pl
|
|
8
|
+
import pyarrow as pa
|
|
9
|
+
from pyarrow import parquet as pq
|
|
10
|
+
|
|
11
|
+
from mage_ai.data.tabular.constants import COLUMN_CHUNK
|
|
12
|
+
from mage_ai.data.tabular.models import DEFAULT_BATCH_ITEMS_VALUE, BatchSettings
|
|
13
|
+
from mage_ai.data.tabular.utils import multi_series_to_frame
|
|
14
|
+
from mage_ai.shared.environments import is_debug
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def append_chunk_column(
|
|
18
|
+
df: pl.DataFrame,
|
|
19
|
+
chunk_size: Optional[int] = None,
|
|
20
|
+
total_rows: Optional[int] = None,
|
|
21
|
+
use_index_as_chunk: Optional[bool] = False,
|
|
22
|
+
index: int = 0,
|
|
23
|
+
) -> pl.DataFrame:
|
|
24
|
+
if total_rows is None:
|
|
25
|
+
total_rows = df.height
|
|
26
|
+
|
|
27
|
+
if use_index_as_chunk:
|
|
28
|
+
chunks = [index] * total_rows
|
|
29
|
+
elif chunk_size is not None:
|
|
30
|
+
chunks = [i // chunk_size for i in range(total_rows)]
|
|
31
|
+
else:
|
|
32
|
+
chunks = [
|
|
33
|
+
0
|
|
34
|
+
] * total_rows # Default to all rows in the same chunk if no parameters are provided
|
|
35
|
+
|
|
36
|
+
return df.with_columns([pl.Series(COLUMN_CHUNK, chunks).cast(pl.Int32)])
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def add_chunk_column(
|
|
40
|
+
df: pl.DataFrame,
|
|
41
|
+
chunk_size: Optional[int] = None,
|
|
42
|
+
num_buckets: Optional[int] = None,
|
|
43
|
+
use_index_as_chunk: Optional[bool] = False,
|
|
44
|
+
index: int = 0,
|
|
45
|
+
) -> pl.DataFrame:
|
|
46
|
+
"""
|
|
47
|
+
Adds a 'chunk' column to the DataFrame based on the specified number
|
|
48
|
+
of buckets or chunk size or uses index as chunk number when asked.
|
|
49
|
+
:param df: Input Polars DataFrame.
|
|
50
|
+
:param num_buckets: The desired number of chunks (buckets).
|
|
51
|
+
:param chunk_size: The number of rows each chunk should contain.
|
|
52
|
+
:param use_index_as_chunk: Use index as the chunk number.
|
|
53
|
+
:param index: Index number when using index as the chunk number.
|
|
54
|
+
:return: DataFrame with an added 'chunk' column.
|
|
55
|
+
"""
|
|
56
|
+
total_rows = df.height
|
|
57
|
+
|
|
58
|
+
if num_buckets is not None:
|
|
59
|
+
# Calculate chunk size based on the total number of rows and the desired number of buckets
|
|
60
|
+
chunk_size = max(total_rows // num_buckets, 1)
|
|
61
|
+
num_buckets = (total_rows + chunk_size - 1) // chunk_size
|
|
62
|
+
|
|
63
|
+
if is_debug():
|
|
64
|
+
print(f'Chunk size: {chunk_size}, Total rows: {total_rows}, Num buckets: {num_buckets}')
|
|
65
|
+
|
|
66
|
+
return append_chunk_column(df, chunk_size, total_rows, use_index_as_chunk, index)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def add_custom_metadata_to_table(table: pa.Table, metadata: Dict) -> pa.Table:
|
|
70
|
+
# This is a placeholder function. Adapt it based on your actual metadata handling.
|
|
71
|
+
# Access existing metadata (if any) and merge with custom metadata
|
|
72
|
+
existing_metadata = table.schema.metadata if table.schema.metadata is not None else {}
|
|
73
|
+
updated_metadata = {
|
|
74
|
+
**existing_metadata,
|
|
75
|
+
**{key.encode(): str(value).encode() for key, value in metadata.items()},
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
# Update PyArrow Table schema with merged metadata
|
|
79
|
+
new_schema = table.schema.with_metadata(updated_metadata)
|
|
80
|
+
return table.replace_schema_metadata(new_schema.metadata)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
def to_parquet_sync(
|
|
84
|
+
output_dir: str,
|
|
85
|
+
df: Optional[Union[pl.DataFrame, pl.Series, pd.Series]] = None,
|
|
86
|
+
dfs: Optional[Union[List[pl.DataFrame], pl.Series, pd.Series]] = None,
|
|
87
|
+
basename_template: Optional[str] = None,
|
|
88
|
+
existing_data_behavior: Optional[str] = None,
|
|
89
|
+
metadata: Optional[Dict] = None,
|
|
90
|
+
partition_cols: Optional[List[str]] = None,
|
|
91
|
+
settings: Optional[BatchSettings] = None,
|
|
92
|
+
) -> Dict[str, int]:
|
|
93
|
+
total_rows = 0
|
|
94
|
+
total_columns = 0
|
|
95
|
+
|
|
96
|
+
for table, partition_columns in __prepare_data(
|
|
97
|
+
output_dir=output_dir,
|
|
98
|
+
df=df,
|
|
99
|
+
dfs=dfs,
|
|
100
|
+
metadata=metadata,
|
|
101
|
+
partition_cols=partition_cols,
|
|
102
|
+
settings=settings,
|
|
103
|
+
):
|
|
104
|
+
pq.write_to_dataset(
|
|
105
|
+
table,
|
|
106
|
+
basename_template=basename_template,
|
|
107
|
+
compression='snappy',
|
|
108
|
+
existing_data_behavior=existing_data_behavior,
|
|
109
|
+
partition_cols=partition_columns,
|
|
110
|
+
root_path=output_dir,
|
|
111
|
+
use_dictionary=True,
|
|
112
|
+
)
|
|
113
|
+
total_rows += table.num_rows
|
|
114
|
+
total_columns = max(len(table.schema.names), total_columns)
|
|
115
|
+
|
|
116
|
+
return dict(
|
|
117
|
+
columns=total_columns,
|
|
118
|
+
rows=total_rows,
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
async def to_parquet_async(
|
|
123
|
+
output_dir: str,
|
|
124
|
+
df: Optional[Union[pl.DataFrame, pl.Series, pd.Series]] = None,
|
|
125
|
+
dfs: Optional[Union[List[pl.DataFrame], pl.Series, pd.Series]] = None,
|
|
126
|
+
basename_template: Optional[str] = None,
|
|
127
|
+
existing_data_behavior: Optional[str] = None,
|
|
128
|
+
metadata: Optional[Dict] = None,
|
|
129
|
+
partition_cols: Optional[List[str]] = None,
|
|
130
|
+
settings: Optional[BatchSettings] = None,
|
|
131
|
+
) -> Dict[str, int]:
|
|
132
|
+
total_rows = 0
|
|
133
|
+
total_columns = 0
|
|
134
|
+
|
|
135
|
+
for table, partition_columns in __prepare_data(
|
|
136
|
+
output_dir=output_dir,
|
|
137
|
+
df=df,
|
|
138
|
+
dfs=dfs,
|
|
139
|
+
metadata=metadata,
|
|
140
|
+
partition_cols=partition_cols,
|
|
141
|
+
settings=settings,
|
|
142
|
+
):
|
|
143
|
+
await __write_to_dataset_async(
|
|
144
|
+
table,
|
|
145
|
+
root_path=output_dir,
|
|
146
|
+
existing_data_behavior=existing_data_behavior,
|
|
147
|
+
partition_cols=partition_columns,
|
|
148
|
+
)
|
|
149
|
+
total_rows += table.num_rows
|
|
150
|
+
total_columns = max(len(table.schema.names), total_columns)
|
|
151
|
+
|
|
152
|
+
return dict(
|
|
153
|
+
columns=total_columns,
|
|
154
|
+
rows=total_rows,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
async def __write_to_dataset_async(
|
|
159
|
+
table: pa.Table,
|
|
160
|
+
root_path: str,
|
|
161
|
+
basename_template: Optional[str] = None,
|
|
162
|
+
existing_data_behavior: Optional[str] = None,
|
|
163
|
+
partition_cols: Optional[List[str]] = None,
|
|
164
|
+
):
|
|
165
|
+
loop = asyncio.get_event_loop()
|
|
166
|
+
return await loop.run_in_executor(
|
|
167
|
+
None,
|
|
168
|
+
pq.write_to_dataset,
|
|
169
|
+
table,
|
|
170
|
+
basename_template=basename_template,
|
|
171
|
+
compression='snappy',
|
|
172
|
+
existing_data_behavior=existing_data_behavior,
|
|
173
|
+
partition_cols=partition_cols,
|
|
174
|
+
root_path=root_path,
|
|
175
|
+
use_dictionary=True,
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def __prepare_data(
|
|
180
|
+
output_dir: str,
|
|
181
|
+
df: Optional[Union[pd.DataFrame, pl.DataFrame, pl.Series, pd.Series]] = None,
|
|
182
|
+
dfs: Optional[Union[List[pd.DataFrame], List[pl.DataFrame], pl.Series, pd.Series]] = None,
|
|
183
|
+
metadata: Optional[Dict] = None,
|
|
184
|
+
partition_cols: Optional[List[str]] = None,
|
|
185
|
+
settings: Optional[BatchSettings] = None,
|
|
186
|
+
):
|
|
187
|
+
"""
|
|
188
|
+
Writes a Polars DataFrame to partitioned Parquet files directly using PyArrow,
|
|
189
|
+
while adding custom metadata and managing partitioning automatically.
|
|
190
|
+
:param df: Polars DataFrame to write.
|
|
191
|
+
:param output_dir: Base directory for writing partitioned Parquet files.
|
|
192
|
+
:param partition_cols: List of column names on which to partition the data.
|
|
193
|
+
:param chunk_size: Number of rows per chunk.
|
|
194
|
+
:param metadata: Dictionary with custom metadata to add to the Parquet files.
|
|
195
|
+
"""
|
|
196
|
+
if not settings:
|
|
197
|
+
settings = BatchSettings()
|
|
198
|
+
|
|
199
|
+
chunk_size = None
|
|
200
|
+
num_buckets = None
|
|
201
|
+
if settings.items and settings.items.maximum:
|
|
202
|
+
chunk_size = settings.items.maximum
|
|
203
|
+
elif settings.count and settings.count.maximum:
|
|
204
|
+
num_buckets = settings.count.maximum
|
|
205
|
+
|
|
206
|
+
if chunk_size is not None and num_buckets is not None:
|
|
207
|
+
chunk_size = DEFAULT_BATCH_ITEMS_VALUE
|
|
208
|
+
|
|
209
|
+
df, dfs, series_sample, object_metadata = multi_series_to_frame(df, dfs)
|
|
210
|
+
|
|
211
|
+
chunk_sizes = [] + ([chunk_size] if chunk_size else [])
|
|
212
|
+
if dfs is not None:
|
|
213
|
+
num_buckets = len(dfs)
|
|
214
|
+
df = pl.DataFrame([])
|
|
215
|
+
|
|
216
|
+
# Process a list of DataFrames with index as chunk if dfs is provided
|
|
217
|
+
for index, dataframe in enumerate(dfs):
|
|
218
|
+
chunk_size_for_index = dataframe.height
|
|
219
|
+
|
|
220
|
+
# Use index as chunk number
|
|
221
|
+
dataframe_with_chunk = append_chunk_column(
|
|
222
|
+
dataframe,
|
|
223
|
+
use_index_as_chunk=True,
|
|
224
|
+
index=index,
|
|
225
|
+
total_rows=chunk_size_for_index,
|
|
226
|
+
)
|
|
227
|
+
|
|
228
|
+
# Convert the Polars DataFrame to a PyArrow Table
|
|
229
|
+
df = df.vstack(dataframe_with_chunk)
|
|
230
|
+
|
|
231
|
+
chunk_sizes.append(chunk_size_for_index)
|
|
232
|
+
if is_debug():
|
|
233
|
+
print(f'Chunk size for index {index}: {chunk_size_for_index}')
|
|
234
|
+
elif df is not None and (chunk_size or num_buckets) and isinstance(df, pl.DataFrame):
|
|
235
|
+
df = add_chunk_column(df, chunk_size=chunk_size, num_buckets=num_buckets)
|
|
236
|
+
|
|
237
|
+
if df is None:
|
|
238
|
+
raise ValueError('No DataFrame provided to write.')
|
|
239
|
+
|
|
240
|
+
metadata = metadata or {}
|
|
241
|
+
if chunk_sizes:
|
|
242
|
+
metadata['chunk_sizes'] = chunk_sizes
|
|
243
|
+
if num_buckets:
|
|
244
|
+
metadata['num_buckets'] = num_buckets
|
|
245
|
+
if object_metadata:
|
|
246
|
+
metadata['object'] = json.dumps(object_metadata)
|
|
247
|
+
|
|
248
|
+
# Convert the Polars DataFrame to a PyArrow Table first
|
|
249
|
+
table = add_custom_metadata_to_table(df.to_arrow(), metadata)
|
|
250
|
+
|
|
251
|
+
if chunk_size or num_buckets:
|
|
252
|
+
partition_cols = (partition_cols or []) + [COLUMN_CHUNK]
|
|
253
|
+
|
|
254
|
+
# Utilize PyArrow's write_to_dataset function to handle partitioning
|
|
255
|
+
yield table, partition_cols
|
|
256
|
+
|
|
257
|
+
partition_directories = glob.glob(f'{output_dir}/*')
|
|
258
|
+
num_partitions = len(partition_directories)
|
|
259
|
+
total_rows = table.num_rows
|
|
260
|
+
total_columns = len(table.schema.names)
|
|
261
|
+
|
|
262
|
+
if is_debug():
|
|
263
|
+
print(
|
|
264
|
+
f'{total_rows} rows with {total_columns} columns '
|
|
265
|
+
f"written to '{output_dir}' across {num_partitions} partitions."
|
|
266
|
+
)
|
|
File without changes
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any, List, Optional
|
|
4
|
+
|
|
5
|
+
from mage_ai.data.constants import InputDataType
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class VariableWrapper:
|
|
9
|
+
def __init__(self, variable, input_data_type: InputDataType):
|
|
10
|
+
self.variable = variable
|
|
11
|
+
self.input_data_type = input_data_type
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def wrap_input_variables(
|
|
15
|
+
block,
|
|
16
|
+
input_data: List[Any],
|
|
17
|
+
block_uuids: List[str],
|
|
18
|
+
variable_uuids: List[List[str]],
|
|
19
|
+
) -> List[Any]:
|
|
20
|
+
return [
|
|
21
|
+
wrap_outputs(outputs, variables, block.input_types(block_uuid))
|
|
22
|
+
for outputs, block_uuid, variables in zip(input_data, block_uuids, variable_uuids)
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def wrap_outputs(
|
|
27
|
+
outputs: Any,
|
|
28
|
+
variable_uuids: List[str],
|
|
29
|
+
input_types: Optional[List[InputDataType]],
|
|
30
|
+
) -> Any:
|
|
31
|
+
n_variables = len(variable_uuids)
|
|
32
|
+
n_outputs = len(outputs)
|
|
33
|
+
|
|
34
|
+
if n_outputs > n_variables:
|
|
35
|
+
raise Exception(
|
|
36
|
+
f'[WRAP_DATA] Too many outputs for the number of variables: {n_outputs} > '
|
|
37
|
+
f'{n_variables}'
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
if not input_types:
|
|
41
|
+
input_types = [InputDataType.DEFAULT]
|
|
42
|
+
if n_outputs < n_outputs:
|
|
43
|
+
input_types += [InputDataType.DEFAULT] * (n_variables - n_outputs)
|
|
44
|
+
|
|
45
|
+
return [
|
|
46
|
+
wrap_data(data, input_data_type)
|
|
47
|
+
for data, input_data_type in zip(outputs, input_types[:n_outputs])
|
|
48
|
+
]
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def wrap_data(data: Any, input_data_type: InputDataType) -> Any:
|
|
52
|
+
if InputDataType.GENERATOR == input_data_type:
|
|
53
|
+
pass
|
|
54
|
+
return data
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
+
import math
|
|
2
|
+
from typing import Dict
|
|
3
|
+
|
|
4
|
+
import numpy as np
|
|
5
|
+
import pandas as pd
|
|
6
|
+
|
|
1
7
|
from mage_ai.data_cleaner.analysis.constants import (
|
|
2
8
|
CHART_TYPE_BAR_HORIZONTAL,
|
|
3
|
-
CHART_TYPE_LINE_CHART,
|
|
4
9
|
CHART_TYPE_HISTOGRAM,
|
|
10
|
+
CHART_TYPE_LINE_CHART,
|
|
5
11
|
DATA_KEY_SCATTER_PLOT,
|
|
6
12
|
DATA_KEY_SCATTER_PLOT_LABELS,
|
|
7
13
|
DATA_KEY_TIME_SERIES,
|
|
@@ -9,18 +15,16 @@ from mage_ai.data_cleaner.analysis.constants import (
|
|
|
9
15
|
)
|
|
10
16
|
from mage_ai.data_cleaner.column_types.constants import ColumnType
|
|
11
17
|
from mage_ai.data_cleaner.estimators.encoders import MultipleColumnLabelEncoder
|
|
12
|
-
import
|
|
13
|
-
import numpy as np
|
|
14
|
-
import pandas as pd
|
|
18
|
+
from mage_ai.shared.parsers import convert_matrix_to_dataframe
|
|
15
19
|
|
|
16
|
-
DD_KEY =
|
|
20
|
+
DD_KEY = "lambda.analysis_charts"
|
|
17
21
|
BUCKETS = 40
|
|
18
22
|
SCATTER_PLOT_SAMPLE_COUNT = 200
|
|
19
23
|
SCATTER_PLOT_CATEGORY_LIMIT = 10
|
|
20
24
|
TIME_SERIES_BUCKETS = 40
|
|
21
25
|
|
|
22
26
|
|
|
23
|
-
def increment(metric, tags=
|
|
27
|
+
def increment(metric, tags: Dict = None):
|
|
24
28
|
pass
|
|
25
29
|
|
|
26
30
|
|
|
@@ -34,13 +38,17 @@ def build_buckets(min_value, max_value, max_buckets, column_type):
|
|
|
34
38
|
diff = 0
|
|
35
39
|
|
|
36
40
|
is_integer = False
|
|
37
|
-
parts = str(diff).split(
|
|
41
|
+
parts = str(diff).split(".")
|
|
38
42
|
if len(parts) == 1:
|
|
39
43
|
is_integer = True
|
|
40
44
|
else:
|
|
41
45
|
is_integer = int(parts[1]) == 0
|
|
42
46
|
|
|
43
|
-
if
|
|
47
|
+
if (
|
|
48
|
+
ColumnType.NUMBER == column_type
|
|
49
|
+
and total_interval <= max_buckets
|
|
50
|
+
and is_integer
|
|
51
|
+
):
|
|
44
52
|
number_of_buckets = int(total_interval)
|
|
45
53
|
bucket_interval = 1
|
|
46
54
|
elif bucket_interval > 1:
|
|
@@ -64,7 +72,10 @@ def build_buckets(min_value, max_value, max_buckets, column_type):
|
|
|
64
72
|
|
|
65
73
|
|
|
66
74
|
def build_histogram_data(col1, series, column_type):
|
|
67
|
-
increment(f
|
|
75
|
+
increment(f"{DD_KEY}.build_histogram_data.start", dict(feature_uuid=col1))
|
|
76
|
+
|
|
77
|
+
if not isinstance(series, pd.Series):
|
|
78
|
+
series = convert_matrix_to_dataframe(series)
|
|
68
79
|
|
|
69
80
|
max_value = series.max() if len(series) >= 1 else None
|
|
70
81
|
min_value = series.min() if len(series) >= 1 else None
|
|
@@ -74,7 +85,7 @@ def build_histogram_data(col1, series, column_type):
|
|
|
74
85
|
if bucket_interval == 0:
|
|
75
86
|
return
|
|
76
87
|
|
|
77
|
-
bins = [b[
|
|
88
|
+
bins = [b["min_value"] for b in buckets] + [buckets[-1]["max_value"]]
|
|
78
89
|
count, _ = np.histogram(series, bins=bins)
|
|
79
90
|
|
|
80
91
|
x = []
|
|
@@ -83,13 +94,13 @@ def build_histogram_data(col1, series, column_type):
|
|
|
83
94
|
for idx, bucket in enumerate(buckets):
|
|
84
95
|
x.append(
|
|
85
96
|
dict(
|
|
86
|
-
max=bucket[
|
|
87
|
-
min=bucket[
|
|
97
|
+
max=bucket["max_value"],
|
|
98
|
+
min=bucket["min_value"],
|
|
88
99
|
)
|
|
89
100
|
)
|
|
90
101
|
y.append(dict(value=count[idx]))
|
|
91
102
|
|
|
92
|
-
increment(f
|
|
103
|
+
increment(f"{DD_KEY}.build_histogram_data.succeeded", dict(feature_uuid=col1))
|
|
93
104
|
|
|
94
105
|
return dict(
|
|
95
106
|
type=CHART_TYPE_HISTOGRAM,
|
|
@@ -114,11 +125,13 @@ def build_correlation_data(df):
|
|
|
114
125
|
if value is not None:
|
|
115
126
|
x.append(dict(label=col2))
|
|
116
127
|
y.append(dict(value=value))
|
|
117
|
-
charts[col1] = [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
charts[col1] = [
|
|
129
|
+
dict(
|
|
130
|
+
type=CHART_TYPE_BAR_HORIZONTAL,
|
|
131
|
+
x=x,
|
|
132
|
+
y=y,
|
|
133
|
+
)
|
|
134
|
+
]
|
|
122
135
|
return charts
|
|
123
136
|
|
|
124
137
|
|
|
@@ -148,11 +161,12 @@ def build_time_series_data(df, features, datetime_column):
|
|
|
148
161
|
df_copy[datetime_column] = datetimes.view(int) / 10**9
|
|
149
162
|
|
|
150
163
|
for bucket in buckets:
|
|
151
|
-
max_value = bucket[
|
|
152
|
-
min_value = bucket[
|
|
164
|
+
max_value = bucket["max_value"]
|
|
165
|
+
min_value = bucket["min_value"]
|
|
153
166
|
|
|
154
167
|
df_filtered = df_copy[
|
|
155
|
-
(df_copy[datetime_column] >= min_value)
|
|
168
|
+
(df_copy[datetime_column] >= min_value)
|
|
169
|
+
& (df_copy[datetime_column] < max_value)
|
|
156
170
|
]
|
|
157
171
|
|
|
158
172
|
x.append(
|
|
@@ -164,8 +178,8 @@ def build_time_series_data(df, features, datetime_column):
|
|
|
164
178
|
|
|
165
179
|
series_count = df_filtered.shape[0]
|
|
166
180
|
for f in features:
|
|
167
|
-
col = f[
|
|
168
|
-
column_type = f[
|
|
181
|
+
col = f["uuid"]
|
|
182
|
+
column_type = f["column_type"]
|
|
169
183
|
if col not in y_dict:
|
|
170
184
|
y_dict[col] = []
|
|
171
185
|
|
|
@@ -233,22 +247,22 @@ def build_overview_data(
|
|
|
233
247
|
datetime_features,
|
|
234
248
|
numeric_features,
|
|
235
249
|
):
|
|
236
|
-
increment(f
|
|
250
|
+
increment(f"{DD_KEY}.build_overview_data.start")
|
|
237
251
|
|
|
238
252
|
time_series = []
|
|
239
253
|
df_copy = df.copy()
|
|
240
254
|
|
|
241
255
|
for feature in datetime_features:
|
|
242
|
-
column_type = feature[
|
|
243
|
-
datetime_column = feature[
|
|
256
|
+
column_type = feature["column_type"]
|
|
257
|
+
datetime_column = feature["uuid"]
|
|
244
258
|
tags = dict(datetime_column=datetime_column)
|
|
245
|
-
increment(f
|
|
259
|
+
increment(f"{DD_KEY}.build_overview_time_series.start", tags)
|
|
246
260
|
|
|
247
261
|
if df_copy[datetime_column].count() <= 1:
|
|
248
262
|
continue
|
|
249
263
|
|
|
250
264
|
df_copy[datetime_column] = pd.to_datetime(
|
|
251
|
-
df[datetime_column], infer_datetime_format=True, errors=
|
|
265
|
+
df[datetime_column], infer_datetime_format=True, errors="coerce"
|
|
252
266
|
)
|
|
253
267
|
df_copy[datetime_column] = df_copy[datetime_column].view(int) / 10**9
|
|
254
268
|
|
|
@@ -262,11 +276,12 @@ def build_overview_data(
|
|
|
262
276
|
y = []
|
|
263
277
|
|
|
264
278
|
for bucket in buckets:
|
|
265
|
-
max_value = bucket[
|
|
266
|
-
min_value = bucket[
|
|
279
|
+
max_value = bucket["max_value"]
|
|
280
|
+
min_value = bucket["min_value"]
|
|
267
281
|
|
|
268
282
|
df_filtered = df_copy[
|
|
269
|
-
(df_copy[datetime_column] >= min_value)
|
|
283
|
+
(df_copy[datetime_column] >= min_value)
|
|
284
|
+
& (df_copy[datetime_column] < max_value)
|
|
270
285
|
]
|
|
271
286
|
|
|
272
287
|
x.append(
|
|
@@ -294,7 +309,7 @@ def build_overview_data(
|
|
|
294
309
|
)
|
|
295
310
|
)
|
|
296
311
|
|
|
297
|
-
increment(f
|
|
312
|
+
increment(f"{DD_KEY}.build_overview_time_series.succeeded", tags)
|
|
298
313
|
|
|
299
314
|
"""
|
|
300
315
|
Build sample data for scatter plot. Sample data consits of two parts:
|
|
@@ -306,7 +321,7 @@ def build_overview_data(
|
|
|
306
321
|
else:
|
|
307
322
|
df_sample = df.copy()
|
|
308
323
|
|
|
309
|
-
df_sample_numeric = df_sample[numeric_features].dropna(axis=1, how=
|
|
324
|
+
df_sample_numeric = df_sample[numeric_features].dropna(axis=1, how="all")
|
|
310
325
|
"""
|
|
311
326
|
Calculate low cardinality categorical features:
|
|
312
327
|
1. unique count <= SCATTER_PLOT_CATEGORY_LIMIT and unique count > 1
|
|
@@ -315,27 +330,34 @@ def build_overview_data(
|
|
|
315
330
|
non_numeric_features = list(set(df.columns) - set(numeric_features))
|
|
316
331
|
non_numeric_nuniques = df_sample[non_numeric_features].nunique()
|
|
317
332
|
non_numeric_nuniques_filtered = non_numeric_nuniques[
|
|
318
|
-
(non_numeric_nuniques <= SCATTER_PLOT_CATEGORY_LIMIT)
|
|
333
|
+
(non_numeric_nuniques <= SCATTER_PLOT_CATEGORY_LIMIT)
|
|
334
|
+
& (non_numeric_nuniques > 1)
|
|
319
335
|
]
|
|
320
336
|
non_numeric_counts = df_sample[non_numeric_features].count()
|
|
321
337
|
sample_count = df_sample.shape[0]
|
|
322
|
-
non_numeric_counts_filtered = non_numeric_counts[
|
|
338
|
+
non_numeric_counts_filtered = non_numeric_counts[
|
|
339
|
+
non_numeric_counts > sample_count / 2
|
|
340
|
+
]
|
|
323
341
|
eligible_category_features = set(non_numeric_nuniques_filtered.index) & set(
|
|
324
342
|
non_numeric_counts_filtered.index
|
|
325
343
|
)
|
|
326
344
|
if len(eligible_category_features) > 0:
|
|
327
345
|
encoder = MultipleColumnLabelEncoder(input_type=str)
|
|
328
|
-
df_sample_category = encoder.fit_transform(
|
|
329
|
-
|
|
346
|
+
df_sample_category = encoder.fit_transform(
|
|
347
|
+
df_sample[eligible_category_features]
|
|
348
|
+
)
|
|
349
|
+
class_mappings = {
|
|
350
|
+
k: list(e.label_classes()) for k, e in encoder.encoders.items()
|
|
351
|
+
}
|
|
330
352
|
df_sample_filtered = pd.concat([df_sample_numeric, df_sample_category], axis=1)
|
|
331
353
|
else:
|
|
332
354
|
class_mappings = dict()
|
|
333
355
|
df_sample_filtered = df_sample_numeric
|
|
334
356
|
|
|
335
|
-
increment(f
|
|
357
|
+
increment(f"{DD_KEY}.build_overview_data.succeeded")
|
|
336
358
|
|
|
337
359
|
return {
|
|
338
360
|
DATA_KEY_TIME_SERIES: time_series,
|
|
339
|
-
DATA_KEY_SCATTER_PLOT: df_sample_filtered.to_dict(
|
|
361
|
+
DATA_KEY_SCATTER_PLOT: df_sample_filtered.to_dict("list"),
|
|
340
362
|
DATA_KEY_SCATTER_PLOT_LABELS: class_mappings,
|
|
341
363
|
}
|