@datarecce/ui 0.1.30 → 0.1.31
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.
- package/dist/api.d.mts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/hooks.d.mts +1 -1
- package/dist/hooks.d.ts +1 -1
- package/dist/{index-BNUP2V_N.d.ts → index-B9lSPJTi.d.ts} +184 -2
- package/dist/index-B9lSPJTi.d.ts.map +1 -0
- package/dist/{index-DOPZuhD8.d.mts → index-IIXVIoOL.d.mts} +253 -71
- package/dist/index-IIXVIoOL.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +4 -0
- package/dist/theme.d.mts +2 -185
- package/dist/theme.d.ts +2 -185
- package/dist/types.d.mts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +4 -2
- package/recce-source/.editorconfig +26 -0
- package/recce-source/.flake8 +37 -0
- package/recce-source/.github/ISSUE_TEMPLATE/bug_report.yml +67 -0
- package/recce-source/.github/ISSUE_TEMPLATE/custom.md +10 -0
- package/recce-source/.github/ISSUE_TEMPLATE/feature_request.yml +42 -0
- package/recce-source/.github/PULL_REQUEST_TEMPLATE.md +21 -0
- package/recce-source/.github/copilot-instructions.md +331 -0
- package/recce-source/.github/instructions/backend-instructions.md +541 -0
- package/recce-source/.github/instructions/frontend-instructions.md +317 -0
- package/recce-source/.github/workflows/build-statics.yaml +72 -0
- package/recce-source/.github/workflows/bump.yaml +48 -0
- package/recce-source/.github/workflows/integration-tests-cloud.yaml +92 -0
- package/recce-source/.github/workflows/integration-tests-sqlmesh.yaml +33 -0
- package/recce-source/.github/workflows/integration-tests.yaml +52 -0
- package/recce-source/.github/workflows/nightly.yaml +246 -0
- package/recce-source/.github/workflows/release.yaml +196 -0
- package/recce-source/.github/workflows/tests-js.yaml +58 -0
- package/recce-source/.github/workflows/tests-python.yaml +128 -0
- package/recce-source/.pre-commit-config.yaml +26 -0
- package/recce-source/CLAUDE.md +483 -0
- package/recce-source/CODE_OF_CONDUCT.md +128 -0
- package/recce-source/CONTRIBUTING.md +107 -0
- package/recce-source/LICENSE +201 -0
- package/recce-source/Makefile +126 -0
- package/recce-source/README.md +182 -0
- package/recce-source/RECCE_CLOUD.md +81 -0
- package/recce-source/SECURITY.md +25 -0
- package/recce-source/docs/PACKAGING.md +340 -0
- package/recce-source/docs/README.md +1 -0
- package/recce-source/integration_tests/dbt/dbt_project.yml +26 -0
- package/recce-source/integration_tests/dbt/models/customers.sql +69 -0
- package/recce-source/integration_tests/dbt/models/docs.md +14 -0
- package/recce-source/integration_tests/dbt/models/orders.sql +56 -0
- package/recce-source/integration_tests/dbt/models/schema.yml +82 -0
- package/recce-source/integration_tests/dbt/models/staging/schema.yml +31 -0
- package/recce-source/integration_tests/dbt/models/staging/stg_customers.sql +22 -0
- package/recce-source/integration_tests/dbt/models/staging/stg_orders.sql +23 -0
- package/recce-source/integration_tests/dbt/models/staging/stg_payments.sql +25 -0
- package/recce-source/integration_tests/dbt/packages.yml +7 -0
- package/recce-source/integration_tests/dbt/profiles.yml +8 -0
- package/recce-source/integration_tests/dbt/seeds/raw_customers.csv +101 -0
- package/recce-source/integration_tests/dbt/seeds/raw_orders.csv +100 -0
- package/recce-source/integration_tests/dbt/seeds/raw_payments.csv +114 -0
- package/recce-source/integration_tests/dbt/seeds/raw_statuses.csv +5 -0
- package/recce-source/integration_tests/dbt/smoke_test.sh +72 -0
- package/recce-source/integration_tests/dbt/smoke_test_cloud.sh +71 -0
- package/recce-source/integration_tests/sqlmesh/__init__.py +0 -0
- package/recce-source/integration_tests/sqlmesh/audits/assert_item_price_above_zero.sql +9 -0
- package/recce-source/integration_tests/sqlmesh/audits/items.sql +7 -0
- package/recce-source/integration_tests/sqlmesh/audits/order_items.sql +7 -0
- package/recce-source/integration_tests/sqlmesh/config.py +171 -0
- package/recce-source/integration_tests/sqlmesh/helper.py +20 -0
- package/recce-source/integration_tests/sqlmesh/hooks/__init__.py +0 -0
- package/recce-source/integration_tests/sqlmesh/macros/__init__.py +0 -0
- package/recce-source/integration_tests/sqlmesh/macros/macros.py +8 -0
- package/recce-source/integration_tests/sqlmesh/macros/macros.sql +8 -0
- package/recce-source/integration_tests/sqlmesh/macros/utils.py +11 -0
- package/recce-source/integration_tests/sqlmesh/metrics/metrics.sql +25 -0
- package/recce-source/integration_tests/sqlmesh/models/customer_revenue_by_day.sql +41 -0
- package/recce-source/integration_tests/sqlmesh/models/customer_revenue_lifetime.sql +60 -0
- package/recce-source/integration_tests/sqlmesh/models/customers.sql +32 -0
- package/recce-source/integration_tests/sqlmesh/models/items.py +95 -0
- package/recce-source/integration_tests/sqlmesh/models/marketing.sql +15 -0
- package/recce-source/integration_tests/sqlmesh/models/order_items.py +95 -0
- package/recce-source/integration_tests/sqlmesh/models/orders.py +70 -0
- package/recce-source/integration_tests/sqlmesh/models/raw_marketing.py +62 -0
- package/recce-source/integration_tests/sqlmesh/models/top_waiters.sql +23 -0
- package/recce-source/integration_tests/sqlmesh/models/waiter_as_customer_by_day.sql +29 -0
- package/recce-source/integration_tests/sqlmesh/models/waiter_names.sql +10 -0
- package/recce-source/integration_tests/sqlmesh/models/waiter_revenue_by_day.sql +29 -0
- package/recce-source/integration_tests/sqlmesh/models/waiters.py +62 -0
- package/recce-source/integration_tests/sqlmesh/prep_env.sh +16 -0
- package/recce-source/integration_tests/sqlmesh/schema.yaml +5 -0
- package/recce-source/integration_tests/sqlmesh/seeds/waiter_names.csv +11 -0
- package/recce-source/integration_tests/sqlmesh/test_server.sh +29 -0
- package/recce-source/integration_tests/sqlmesh/tests/test_customer_revenue_by_day.yaml +63 -0
- package/recce-source/integration_tests/sqlmesh/tests/test_order_items.yaml +72 -0
- package/recce-source/js/.editorconfig +27 -0
- package/recce-source/js/.env.development +5 -0
- package/recce-source/js/.husky/pre-commit +29 -0
- package/recce-source/js/.nvmrc +1 -0
- package/recce-source/js/README.md +39 -0
- package/recce-source/js/app/(mainComponents)/DisplayModeToggle.tsx +65 -0
- package/recce-source/js/app/(mainComponents)/NavBar.tsx +228 -0
- package/recce-source/js/app/(mainComponents)/RecceVersionBadge.tsx +107 -0
- package/recce-source/js/app/(mainComponents)/TopBar.tsx +252 -0
- package/recce-source/js/app/@lineage/default.tsx +20 -0
- package/recce-source/js/app/@lineage/page.tsx +14 -0
- package/recce-source/js/app/MainLayout.tsx +170 -0
- package/recce-source/js/app/Providers.tsx +49 -0
- package/recce-source/js/app/checks/page.tsx +296 -0
- package/recce-source/js/app/error.tsx +93 -0
- package/recce-source/js/app/favicon.ico +0 -0
- package/recce-source/js/app/global-error.tsx +115 -0
- package/recce-source/js/app/global.css +82 -0
- package/recce-source/js/app/layout.tsx +48 -0
- package/recce-source/js/app/lineage/page.tsx +15 -0
- package/recce-source/js/app/page.tsx +12 -0
- package/recce-source/js/app/query/page.tsx +8 -0
- package/recce-source/js/biome.json +313 -0
- package/recce-source/js/jest.config.js +34 -0
- package/recce-source/js/jest.globals.d.ts +32 -0
- package/recce-source/js/jest.setup.js +91 -0
- package/recce-source/js/next.config.js +16 -0
- package/recce-source/js/package-lock.json +13843 -0
- package/recce-source/js/package.json +123 -0
- package/recce-source/js/pnpm-lock.yaml +9235 -0
- package/recce-source/js/pnpm-workspace.yaml +6 -0
- package/recce-source/js/postcss.config.js +5 -0
- package/recce-source/js/public/auth_callback.html +68 -0
- package/recce-source/js/public/imgs/feedback/thumbs-down.png +0 -0
- package/recce-source/js/public/imgs/feedback/thumbs-up.png +0 -0
- package/recce-source/js/public/imgs/reload-image.svg +4 -0
- package/recce-source/js/public/logo/recce-logo-white.png +0 -0
- package/recce-source/js/src/components/AuthModal/AuthModal.tsx +202 -0
- package/recce-source/js/src/components/app/AvatarDropdown.tsx +159 -0
- package/recce-source/js/src/components/app/EnvInfo.tsx +357 -0
- package/recce-source/js/src/components/app/Filename.tsx +388 -0
- package/recce-source/js/src/components/app/SetupConnectionPopover.tsx +91 -0
- package/recce-source/js/src/components/app/StateExporter.tsx +57 -0
- package/recce-source/js/src/components/app/StateImporter.tsx +198 -0
- package/recce-source/js/src/components/app/StateSharing.tsx +145 -0
- package/recce-source/js/src/components/app/StateSynchronizer.tsx +205 -0
- package/recce-source/js/src/components/charts/HistogramChart.tsx +291 -0
- package/recce-source/js/src/components/charts/SquareIcon.tsx +51 -0
- package/recce-source/js/src/components/charts/TopKSummaryList.tsx +457 -0
- package/recce-source/js/src/components/charts/chartTheme.ts +74 -0
- package/recce-source/js/src/components/check/CheckBreadcrumb.tsx +97 -0
- package/recce-source/js/src/components/check/CheckDescription.tsx +134 -0
- package/recce-source/js/src/components/check/CheckDetail.tsx +797 -0
- package/recce-source/js/src/components/check/CheckEmptyState.tsx +84 -0
- package/recce-source/js/src/components/check/CheckList.tsx +320 -0
- package/recce-source/js/src/components/check/LineageDiffView.tsx +32 -0
- package/recce-source/js/src/components/check/PresetCheckTemplateView.tsx +48 -0
- package/recce-source/js/src/components/check/SchemaDiffView.tsx +290 -0
- package/recce-source/js/src/components/check/check.ts +25 -0
- package/recce-source/js/src/components/check/timeline/CheckTimeline.tsx +163 -0
- package/recce-source/js/src/components/check/timeline/CommentInput.tsx +84 -0
- package/recce-source/js/src/components/check/timeline/TimelineEvent.tsx +468 -0
- package/recce-source/js/src/components/check/timeline/index.ts +12 -0
- package/recce-source/js/src/components/check/utils.ts +12 -0
- package/recce-source/js/src/components/data-grid/ScreenshotDataGrid.tsx +333 -0
- package/recce-source/js/src/components/data-grid/agGridStyles.css +55 -0
- package/recce-source/js/src/components/data-grid/agGridTheme.ts +43 -0
- package/recce-source/js/src/components/editor/CodeEditor.tsx +107 -0
- package/recce-source/js/src/components/editor/DiffEditor.tsx +162 -0
- package/recce-source/js/src/components/editor/index.ts +12 -0
- package/recce-source/js/src/components/errorboundary/ErrorBoundary.tsx +87 -0
- package/recce-source/js/src/components/histogram/HistogramDiffForm.tsx +147 -0
- package/recce-source/js/src/components/histogram/HistogramDiffResultView.tsx +63 -0
- package/recce-source/js/src/components/icons/index.tsx +142 -0
- package/recce-source/js/src/components/lineage/ActionControl.tsx +63 -0
- package/recce-source/js/src/components/lineage/ActionTag.tsx +141 -0
- package/recce-source/js/src/components/lineage/ChangeStatusLegend.tsx +46 -0
- package/recce-source/js/src/components/lineage/ColumnLevelLineageControl.tsx +327 -0
- package/recce-source/js/src/components/lineage/ColumnLevelLineageLegend.tsx +57 -0
- package/recce-source/js/src/components/lineage/GraphColumnNode.tsx +199 -0
- package/recce-source/js/src/components/lineage/GraphEdge.tsx +59 -0
- package/recce-source/js/src/components/lineage/GraphNode.tsx +555 -0
- package/recce-source/js/src/components/lineage/LineagePage.tsx +10 -0
- package/recce-source/js/src/components/lineage/LineageView.tsx +1384 -0
- package/recce-source/js/src/components/lineage/LineageViewContext.tsx +86 -0
- package/recce-source/js/src/components/lineage/LineageViewContextMenu.tsx +637 -0
- package/recce-source/js/src/components/lineage/LineageViewNotification.tsx +64 -0
- package/recce-source/js/src/components/lineage/LineageViewTopBar.tsx +596 -0
- package/recce-source/js/src/components/lineage/NodeSqlView.tsx +136 -0
- package/recce-source/js/src/components/lineage/NodeTag.tsx +278 -0
- package/recce-source/js/src/components/lineage/NodeView.tsx +642 -0
- package/recce-source/js/src/components/lineage/SandboxView.tsx +436 -0
- package/recce-source/js/src/components/lineage/ServerDisconnectedModalContent.tsx +105 -0
- package/recce-source/js/src/components/lineage/SetupConnectionBanner.tsx +52 -0
- package/recce-source/js/src/components/lineage/SingleEnvironmentQueryView.tsx +152 -0
- package/recce-source/js/src/components/lineage/graph.test.ts +31 -0
- package/recce-source/js/src/components/lineage/graph.ts +58 -0
- package/recce-source/js/src/components/lineage/lineage.test.ts +169 -0
- package/recce-source/js/src/components/lineage/lineage.ts +521 -0
- package/recce-source/js/src/components/lineage/styles.css +42 -0
- package/recce-source/js/src/components/lineage/styles.tsx +165 -0
- package/recce-source/js/src/components/lineage/useMultiNodesAction.ts +352 -0
- package/recce-source/js/src/components/lineage/useValueDiffAlertDialog.tsx +108 -0
- package/recce-source/js/src/components/onboarding-guide/Notification.tsx +62 -0
- package/recce-source/js/src/components/profile/ProfileDiffForm.tsx +134 -0
- package/recce-source/js/src/components/profile/ProfileDiffResultView.tsx +245 -0
- package/recce-source/js/src/components/query/ChangedOnlyCheckbox.tsx +29 -0
- package/recce-source/js/src/components/query/DiffText.tsx +120 -0
- package/recce-source/js/src/components/query/QueryDiffResultView.tsx +470 -0
- package/recce-source/js/src/components/query/QueryForm.tsx +80 -0
- package/recce-source/js/src/components/query/QueryPage.tsx +282 -0
- package/recce-source/js/src/components/query/QueryResultView.tsx +180 -0
- package/recce-source/js/src/components/query/SetupConnectionGuide.tsx +57 -0
- package/recce-source/js/src/components/query/SqlEditor.tsx +245 -0
- package/recce-source/js/src/components/query/ToggleSwitch.tsx +84 -0
- package/recce-source/js/src/components/query/styles.css +21 -0
- package/recce-source/js/src/components/routing/DirectUrlAccess.test.tsx +428 -0
- package/recce-source/js/src/components/routing/LineageStatePreservation.test.tsx +311 -0
- package/recce-source/js/src/components/routing/Navigation.test.tsx +256 -0
- package/recce-source/js/src/components/rowcount/RowCountDiffResultView.tsx +109 -0
- package/recce-source/js/src/components/rowcount/delta.ts +11 -0
- package/recce-source/js/src/components/run/RunList.tsx +303 -0
- package/recce-source/js/src/components/run/RunModal.tsx +191 -0
- package/recce-source/js/src/components/run/RunPage.tsx +26 -0
- package/recce-source/js/src/components/run/RunResultPane.tsx +454 -0
- package/recce-source/js/src/components/run/RunStatusAndDate.tsx +106 -0
- package/recce-source/js/src/components/run/RunToolbar.tsx +70 -0
- package/recce-source/js/src/components/run/RunView.tsx +196 -0
- package/recce-source/js/src/components/run/registry.ts +214 -0
- package/recce-source/js/src/components/run/types.ts +14 -0
- package/recce-source/js/src/components/schema/ColumnNameCell.test.tsx +169 -0
- package/recce-source/js/src/components/schema/ColumnNameCell.tsx +198 -0
- package/recce-source/js/src/components/schema/SchemaView.tsx +337 -0
- package/recce-source/js/src/components/schema/schemaDiff.ts +32 -0
- package/recce-source/js/src/components/schema/style.css +134 -0
- package/recce-source/js/src/components/screenshot/ScreenshotBox.tsx +39 -0
- package/recce-source/js/src/components/shared/HistoryToggle.tsx +35 -0
- package/recce-source/js/src/components/split/Split.tsx +40 -0
- package/recce-source/js/src/components/split/styles.css +24 -0
- package/recce-source/js/src/components/summary/ChangeSummary.tsx +264 -0
- package/recce-source/js/src/components/summary/SchemaSummary.tsx +123 -0
- package/recce-source/js/src/components/summary/SummaryView.tsx +29 -0
- package/recce-source/js/src/components/timeout/IdleTimeoutBadge.tsx +48 -0
- package/recce-source/js/src/components/top-k/TopKDiffForm.tsx +58 -0
- package/recce-source/js/src/components/top-k/TopKDiffResultView.tsx +73 -0
- package/recce-source/js/src/components/ui/dataGrid/DataFrameColumnGroupHeader.tsx +228 -0
- package/recce-source/js/src/components/ui/dataGrid/DataFrameColumnHeader.tsx +113 -0
- package/recce-source/js/src/components/ui/dataGrid/defaultRenderCell.tsx +72 -0
- package/recce-source/js/src/components/ui/dataGrid/index.ts +23 -0
- package/recce-source/js/src/components/ui/dataGrid/inlineRenderCell.test.tsx +607 -0
- package/recce-source/js/src/components/ui/dataGrid/inlineRenderCell.tsx +211 -0
- package/recce-source/js/src/components/ui/dataGrid/schemaCells.test.tsx +452 -0
- package/recce-source/js/src/components/ui/dataGrid/schemaCells.tsx +142 -0
- package/recce-source/js/src/components/ui/dataGrid/valueDiffCells.test.tsx +178 -0
- package/recce-source/js/src/components/ui/dataGrid/valueDiffCells.tsx +275 -0
- package/recce-source/js/src/components/ui/markdown/ExternalLinkConfirmDialog.tsx +134 -0
- package/recce-source/js/src/components/ui/markdown/MarkdownContent.tsx +364 -0
- package/recce-source/js/src/components/ui/mui/index.ts +13 -0
- package/recce-source/js/src/components/ui/mui-provider.tsx +67 -0
- package/recce-source/js/src/components/ui/mui-theme.ts +1039 -0
- package/recce-source/js/src/components/ui/mui-utils.ts +113 -0
- package/recce-source/js/src/components/ui/toaster.tsx +288 -0
- package/recce-source/js/src/components/valuediff/ValueDiffDetailResultView.tsx +217 -0
- package/recce-source/js/src/components/valuediff/ValueDiffForm.tsx +246 -0
- package/recce-source/js/src/components/valuediff/ValueDiffResultView.tsx +82 -0
- package/recce-source/js/src/components/valuediff/shared.ts +33 -0
- package/recce-source/js/src/constants/tooltipMessage.ts +3 -0
- package/recce-source/js/src/constants/urls.ts +1 -0
- package/recce-source/js/src/lib/UrlHash.ts +12 -0
- package/recce-source/js/src/lib/api/adhocQuery.ts +70 -0
- package/recce-source/js/src/lib/api/axiosClient.ts +9 -0
- package/recce-source/js/src/lib/api/cacheKeys.ts +13 -0
- package/recce-source/js/src/lib/api/checkEvents.ts +252 -0
- package/recce-source/js/src/lib/api/checks.ts +129 -0
- package/recce-source/js/src/lib/api/cll.ts +53 -0
- package/recce-source/js/src/lib/api/connectToCloud.ts +13 -0
- package/recce-source/js/src/lib/api/flag.ts +37 -0
- package/recce-source/js/src/lib/api/info.ts +198 -0
- package/recce-source/js/src/lib/api/instanceInfo.ts +25 -0
- package/recce-source/js/src/lib/api/keepAlive.ts +108 -0
- package/recce-source/js/src/lib/api/lineagecheck.ts +35 -0
- package/recce-source/js/src/lib/api/localStorageKeys.ts +7 -0
- package/recce-source/js/src/lib/api/models.ts +59 -0
- package/recce-source/js/src/lib/api/profile.ts +65 -0
- package/recce-source/js/src/lib/api/rowcount.ts +19 -0
- package/recce-source/js/src/lib/api/runs.ts +174 -0
- package/recce-source/js/src/lib/api/schemacheck.ts +31 -0
- package/recce-source/js/src/lib/api/select.ts +25 -0
- package/recce-source/js/src/lib/api/sessionStorageKeys.ts +8 -0
- package/recce-source/js/src/lib/api/state.ts +117 -0
- package/recce-source/js/src/lib/api/track.ts +281 -0
- package/recce-source/js/src/lib/api/types.ts +284 -0
- package/recce-source/js/src/lib/api/user.ts +42 -0
- package/recce-source/js/src/lib/api/valuediff.ts +46 -0
- package/recce-source/js/src/lib/api/version.ts +40 -0
- package/recce-source/js/src/lib/const.ts +9 -0
- package/recce-source/js/src/lib/dataGrid/crossFunctionConsistency.test.ts +626 -0
- package/recce-source/js/src/lib/dataGrid/dataGridFactory.test.ts +2140 -0
- package/recce-source/js/src/lib/dataGrid/dataGridFactory.ts +397 -0
- package/recce-source/js/src/lib/dataGrid/generators/rowCountUtils.test.ts +132 -0
- package/recce-source/js/src/lib/dataGrid/generators/rowCountUtils.ts +126 -0
- package/recce-source/js/src/lib/dataGrid/generators/toDataDiffGrid.test.ts +1627 -0
- package/recce-source/js/src/lib/dataGrid/generators/toDataDiffGrid.ts +140 -0
- package/recce-source/js/src/lib/dataGrid/generators/toDataGrid.ts +67 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDataGrid.test.ts +142 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDataGrid.ts +71 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDiffDataGrid.test.ts +258 -0
- package/recce-source/js/src/lib/dataGrid/generators/toRowCountDiffDataGrid.ts +153 -0
- package/recce-source/js/src/lib/dataGrid/generators/toSchemaDataGrid.test.ts +951 -0
- package/recce-source/js/src/lib/dataGrid/generators/toSchemaDataGrid.ts +221 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDataGrid.test.ts +395 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDataGrid.ts +184 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDiffGrid.test.ts +884 -0
- package/recce-source/js/src/lib/dataGrid/generators/toValueDiffGrid.ts +113 -0
- package/recce-source/js/src/lib/dataGrid/index.ts +51 -0
- package/recce-source/js/src/lib/dataGrid/propertyBased.test.ts +858 -0
- package/recce-source/js/src/lib/dataGrid/shared/columnBuilders.test.ts +482 -0
- package/recce-source/js/src/lib/dataGrid/shared/columnBuilders.ts +345 -0
- package/recce-source/js/src/lib/dataGrid/shared/dataTypeEdgeCases.test.ts +698 -0
- package/recce-source/js/src/lib/dataGrid/shared/diffColumnBuilder.test.tsx +820 -0
- package/recce-source/js/src/lib/dataGrid/shared/diffColumnBuilder.tsx +277 -0
- package/recce-source/js/src/lib/dataGrid/shared/gridUtils.test.ts +785 -0
- package/recce-source/js/src/lib/dataGrid/shared/gridUtils.ts +370 -0
- package/recce-source/js/src/lib/dataGrid/shared/index.ts +81 -0
- package/recce-source/js/src/lib/dataGrid/shared/rowBuilders.test.ts +909 -0
- package/recce-source/js/src/lib/dataGrid/shared/rowBuilders.ts +325 -0
- package/recce-source/js/src/lib/dataGrid/shared/simpleColumnBuilder.tsx +240 -0
- package/recce-source/js/src/lib/dataGrid/shared/toDiffColumn.test.tsx +719 -0
- package/recce-source/js/src/lib/dataGrid/shared/toDiffColumn.tsx +231 -0
- package/recce-source/js/src/lib/dataGrid/shared/validation.test.ts +559 -0
- package/recce-source/js/src/lib/dataGrid/shared/validation.ts +367 -0
- package/recce-source/js/src/lib/dataGrid/warehouseNamingConventions.test.ts +1117 -0
- package/recce-source/js/src/lib/formatSelect.ts +50 -0
- package/recce-source/js/src/lib/hooks/ApiConfigContext.tsx +181 -0
- package/recce-source/js/src/lib/hooks/IdleTimeoutContext.tsx +177 -0
- package/recce-source/js/src/lib/hooks/LineageGraphContext.tsx +512 -0
- package/recce-source/js/src/lib/hooks/RecceActionContext.tsx +269 -0
- package/recce-source/js/src/lib/hooks/RecceCheckContext.tsx +33 -0
- package/recce-source/js/src/lib/hooks/RecceContextProvider.tsx +54 -0
- package/recce-source/js/src/lib/hooks/RecceInstanceContext.tsx +129 -0
- package/recce-source/js/src/lib/hooks/RecceQueryContext.tsx +98 -0
- package/recce-source/js/src/lib/hooks/RecceShareStateContext.tsx +59 -0
- package/recce-source/js/src/lib/hooks/ScreenShot.tsx +399 -0
- package/recce-source/js/src/lib/hooks/useAppRouter.test.ts +211 -0
- package/recce-source/js/src/lib/hooks/useAppRouter.ts +200 -0
- package/recce-source/js/src/lib/hooks/useCheckEvents.ts +99 -0
- package/recce-source/js/src/lib/hooks/useCheckToast.tsx +14 -0
- package/recce-source/js/src/lib/hooks/useClipBoardToast.tsx +27 -0
- package/recce-source/js/src/lib/hooks/useCountdownToast.tsx +102 -0
- package/recce-source/js/src/lib/hooks/useFeedbackCollectionToast.tsx +130 -0
- package/recce-source/js/src/lib/hooks/useGuideToast.tsx +45 -0
- package/recce-source/js/src/lib/hooks/useIdleDetection.tsx +185 -0
- package/recce-source/js/src/lib/hooks/useModelColumns.tsx +113 -0
- package/recce-source/js/src/lib/hooks/useRecceInstanceInfo.tsx +13 -0
- package/recce-source/js/src/lib/hooks/useRecceServerFlag.tsx +13 -0
- package/recce-source/js/src/lib/hooks/useRun.tsx +89 -0
- package/recce-source/js/src/lib/hooks/useThemeColors.ts +115 -0
- package/recce-source/js/src/lib/mergeKeys.test.ts +89 -0
- package/recce-source/js/src/lib/mergeKeys.ts +86 -0
- package/recce-source/js/src/lib/result/ResultErrorFallback.tsx +9 -0
- package/recce-source/js/src/lib/utils/formatTime.ts +84 -0
- package/recce-source/js/src/lib/utils/urls.ts +16 -0
- package/recce-source/js/src/utils/DropdownValuesInput.tsx +297 -0
- package/recce-source/js/src/utils/formatters.tsx +237 -0
- package/recce-source/js/src/utils/transforms.ts +81 -0
- package/recce-source/js/tsconfig.json +47 -0
- package/recce-source/macros/README.md +8 -0
- package/recce-source/macros/recce_athena.sql +73 -0
- package/recce-source/pyproject.toml +109 -0
- package/recce-source/recce/VERSION +1 -0
- package/recce-source/recce/__init__.py +84 -0
- package/recce-source/recce/adapter/__init__.py +0 -0
- package/recce-source/recce/adapter/base.py +109 -0
- package/recce-source/recce/adapter/dbt_adapter/__init__.py +1699 -0
- package/recce-source/recce/adapter/dbt_adapter/dbt_version.py +42 -0
- package/recce-source/recce/adapter/sqlmesh_adapter.py +141 -0
- package/recce-source/recce/apis/__init__.py +0 -0
- package/recce-source/recce/apis/check_api.py +203 -0
- package/recce-source/recce/apis/check_events_api.py +353 -0
- package/recce-source/recce/apis/check_func.py +130 -0
- package/recce-source/recce/apis/run_api.py +130 -0
- package/recce-source/recce/apis/run_func.py +258 -0
- package/recce-source/recce/artifact.py +266 -0
- package/recce-source/recce/cli.py +1846 -0
- package/recce-source/recce/config.py +127 -0
- package/recce-source/recce/connect_to_cloud.py +138 -0
- package/recce-source/recce/core.py +334 -0
- package/recce-source/recce/diff.py +26 -0
- package/recce-source/recce/event/CONFIG +1 -0
- package/recce-source/recce/event/SENTRY_DNS +1 -0
- package/recce-source/recce/event/__init__.py +304 -0
- package/recce-source/recce/event/collector.py +184 -0
- package/recce-source/recce/event/track.py +158 -0
- package/recce-source/recce/exceptions.py +21 -0
- package/recce-source/recce/git.py +77 -0
- package/recce-source/recce/github.py +222 -0
- package/recce-source/recce/mcp_server.py +861 -0
- package/recce-source/recce/models/__init__.py +6 -0
- package/recce-source/recce/models/check.py +473 -0
- package/recce-source/recce/models/run.py +46 -0
- package/recce-source/recce/models/types.py +218 -0
- package/recce-source/recce/pull_request.py +124 -0
- package/recce-source/recce/run.py +390 -0
- package/recce-source/recce/server.py +877 -0
- package/recce-source/recce/state/__init__.py +31 -0
- package/recce-source/recce/state/cloud.py +644 -0
- package/recce-source/recce/state/const.py +26 -0
- package/recce-source/recce/state/local.py +56 -0
- package/recce-source/recce/state/state.py +119 -0
- package/recce-source/recce/state/state_loader.py +174 -0
- package/recce-source/recce/summary.py +575 -0
- package/recce-source/recce/tasks/__init__.py +23 -0
- package/recce-source/recce/tasks/core.py +134 -0
- package/recce-source/recce/tasks/dataframe.py +170 -0
- package/recce-source/recce/tasks/histogram.py +433 -0
- package/recce-source/recce/tasks/lineage.py +19 -0
- package/recce-source/recce/tasks/profile.py +298 -0
- package/recce-source/recce/tasks/query.py +450 -0
- package/recce-source/recce/tasks/rowcount.py +277 -0
- package/recce-source/recce/tasks/schema.py +65 -0
- package/recce-source/recce/tasks/top_k.py +172 -0
- package/recce-source/recce/tasks/utils.py +147 -0
- package/recce-source/recce/tasks/valuediff.py +497 -0
- package/recce-source/recce/util/__init__.py +4 -0
- package/recce-source/recce/util/api_token.py +80 -0
- package/recce-source/recce/util/breaking.py +330 -0
- package/recce-source/recce/util/cache.py +25 -0
- package/recce-source/recce/util/cll.py +355 -0
- package/recce-source/recce/util/cloud/__init__.py +15 -0
- package/recce-source/recce/util/cloud/base.py +115 -0
- package/recce-source/recce/util/cloud/check_events.py +190 -0
- package/recce-source/recce/util/cloud/checks.py +242 -0
- package/recce-source/recce/util/io.py +120 -0
- package/recce-source/recce/util/lineage.py +83 -0
- package/recce-source/recce/util/logger.py +25 -0
- package/recce-source/recce/util/onboarding_state.py +45 -0
- package/recce-source/recce/util/perf_tracking.py +85 -0
- package/recce-source/recce/util/pydantic_model.py +22 -0
- package/recce-source/recce/util/recce_cloud.py +454 -0
- package/recce-source/recce/util/singleton.py +18 -0
- package/recce-source/recce/util/startup_perf.py +121 -0
- package/recce-source/recce/yaml/__init__.py +58 -0
- package/recce-source/recce_cloud/README.md +780 -0
- package/recce-source/recce_cloud/VERSION +1 -0
- package/recce-source/recce_cloud/__init__.py +24 -0
- package/recce-source/recce_cloud/api/__init__.py +17 -0
- package/recce-source/recce_cloud/api/base.py +132 -0
- package/recce-source/recce_cloud/api/client.py +186 -0
- package/recce-source/recce_cloud/api/exceptions.py +26 -0
- package/recce-source/recce_cloud/api/factory.py +63 -0
- package/recce-source/recce_cloud/api/github.py +106 -0
- package/recce-source/recce_cloud/api/gitlab.py +111 -0
- package/recce-source/recce_cloud/artifact.py +57 -0
- package/recce-source/recce_cloud/ci_providers/__init__.py +9 -0
- package/recce-source/recce_cloud/ci_providers/base.py +82 -0
- package/recce-source/recce_cloud/ci_providers/detector.py +147 -0
- package/recce-source/recce_cloud/ci_providers/github_actions.py +136 -0
- package/recce-source/recce_cloud/ci_providers/gitlab_ci.py +130 -0
- package/recce-source/recce_cloud/cli.py +434 -0
- package/recce-source/recce_cloud/download.py +230 -0
- package/recce-source/recce_cloud/hatch_build.py +20 -0
- package/recce-source/recce_cloud/pyproject.toml +49 -0
- package/recce-source/recce_cloud/upload.py +214 -0
- package/recce-source/test.py +0 -0
- package/recce-source/tests/__init__.py +0 -0
- package/recce-source/tests/adapter/__init__.py +0 -0
- package/recce-source/tests/adapter/dbt_adapter/__init__.py +0 -0
- package/recce-source/tests/adapter/dbt_adapter/conftest.py +17 -0
- package/recce-source/tests/adapter/dbt_adapter/dbt_test_helper.py +298 -0
- package/recce-source/tests/adapter/dbt_adapter/test_dbt_adapter.py +25 -0
- package/recce-source/tests/adapter/dbt_adapter/test_dbt_cll.py +717 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/dbt_project.yml +4 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/manifest.json +1 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/package-lock.yml +8 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/packages.yml +7 -0
- package/recce-source/tests/adapter/dbt_adapter/test_proj/profiles.yml +6 -0
- package/recce-source/tests/adapter/dbt_adapter/test_selector.py +205 -0
- package/recce-source/tests/apis/__init__.py +0 -0
- package/recce-source/tests/apis/row_count_diff.json +59 -0
- package/recce-source/tests/apis/test_check_events_api.py +615 -0
- package/recce-source/tests/apis/test_run_func.py +433 -0
- package/recce-source/tests/catalog.json +527 -0
- package/recce-source/tests/data/manifest/base/catalog.json +1 -0
- package/recce-source/tests/data/manifest/base/manifest.json +1 -0
- package/recce-source/tests/data/manifest/pr2/catalog.json +1 -0
- package/recce-source/tests/data/manifest/pr2/manifest.json +1 -0
- package/recce-source/tests/manifest.json +10655 -0
- package/recce-source/tests/models/__init__.py +0 -0
- package/recce-source/tests/models/test_check.py +731 -0
- package/recce-source/tests/models/test_run_models.py +295 -0
- package/recce-source/tests/recce_cloud/__init__.py +0 -0
- package/recce-source/tests/recce_cloud/test_ci_providers.py +351 -0
- package/recce-source/tests/recce_cloud/test_cli.py +735 -0
- package/recce-source/tests/recce_cloud/test_client.py +379 -0
- package/recce-source/tests/recce_cloud/test_platform_clients.py +483 -0
- package/recce-source/tests/recce_state.json +1 -0
- package/recce-source/tests/state/test_cloud.py +719 -0
- package/recce-source/tests/state/test_local.py +164 -0
- package/recce-source/tests/state/test_state_loader.py +211 -0
- package/recce-source/tests/tasks/__init__.py +0 -0
- package/recce-source/tests/tasks/conftest.py +4 -0
- package/recce-source/tests/tasks/test_histogram.py +129 -0
- package/recce-source/tests/tasks/test_lineage.py +55 -0
- package/recce-source/tests/tasks/test_preset_checks.py +64 -0
- package/recce-source/tests/tasks/test_profile.py +397 -0
- package/recce-source/tests/tasks/test_query.py +528 -0
- package/recce-source/tests/tasks/test_row_count.py +133 -0
- package/recce-source/tests/tasks/test_schema.py +122 -0
- package/recce-source/tests/tasks/test_top_k.py +77 -0
- package/recce-source/tests/tasks/test_utils.py +439 -0
- package/recce-source/tests/tasks/test_valuediff.py +361 -0
- package/recce-source/tests/test_cli.py +236 -0
- package/recce-source/tests/test_cli_mcp_optional.py +45 -0
- package/recce-source/tests/test_cloud_listing_cli.py +324 -0
- package/recce-source/tests/test_config.py +43 -0
- package/recce-source/tests/test_connect_to_cloud.py +82 -0
- package/recce-source/tests/test_core.py +174 -0
- package/recce-source/tests/test_dbt.py +36 -0
- package/recce-source/tests/test_mcp_server.py +505 -0
- package/recce-source/tests/test_pull_request.py +130 -0
- package/recce-source/tests/test_server.py +202 -0
- package/recce-source/tests/test_server_lifespan.py +138 -0
- package/recce-source/tests/test_summary.py +73 -0
- package/recce-source/tests/util/__init__.py +0 -0
- package/recce-source/tests/util/cloud/__init__.py +0 -0
- package/recce-source/tests/util/cloud/test_check_events.py +255 -0
- package/recce-source/tests/util/cloud/test_checks.py +204 -0
- package/recce-source/tests/util/test_api_token.py +119 -0
- package/recce-source/tests/util/test_breaking.py +1427 -0
- package/recce-source/tests/util/test_cll.py +706 -0
- package/recce-source/tests/util/test_lineage.py +122 -0
- package/recce-source/tests/util/test_onboarding_state.py +84 -0
- package/recce-source/tests/util/test_recce_cloud.py +231 -0
- package/recce-source/tox.ini +40 -0
- package/recce-source/uv.lock +3928 -0
- package/src/api/index.ts +32 -0
- package/src/components/index.ts +154 -0
- package/src/global.d.ts +14 -0
- package/src/hooks/index.ts +56 -0
- package/src/index.ts +17 -0
- package/src/lib/hooks/RouteConfigContext.ts +139 -0
- package/src/lib/hooks/useAppRouter.ts +240 -0
- package/src/mui-augmentation.d.ts +139 -0
- package/src/theme/index.ts +13 -0
- package/src/theme.ts +23 -0
- package/src/types/index.ts +23 -0
- package/dist/index-BNUP2V_N.d.ts.map +0 -1
- package/dist/index-DOPZuhD8.d.mts.map +0 -1
- package/dist/theme.d.mts.map +0 -1
- package/dist/theme.d.ts.map +0 -1
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { FaCamera, FaCube, FaDatabase, FaSeedling } from "react-icons/fa";
|
|
3
|
+
import { FaChartSimple, FaCircleNodes, FaGauge } from "react-icons/fa6";
|
|
4
|
+
import { VscDiffAdded, VscDiffModified, VscDiffRemoved } from "react-icons/vsc";
|
|
5
|
+
import { token } from "@/components/ui/mui-theme";
|
|
6
|
+
|
|
7
|
+
export const IconAdded = VscDiffAdded;
|
|
8
|
+
export const IconRemoved = VscDiffRemoved;
|
|
9
|
+
export const IconModified = VscDiffModified;
|
|
10
|
+
export const IconChanged = (props: React.SVGProps<SVGSVGElement>) => {
|
|
11
|
+
return (
|
|
12
|
+
<svg
|
|
13
|
+
stroke="currentColor"
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
strokeWidth="0"
|
|
16
|
+
viewBox="0 0 16 16"
|
|
17
|
+
height="1em"
|
|
18
|
+
width="1em"
|
|
19
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
+
{...props}
|
|
21
|
+
>
|
|
22
|
+
<path
|
|
23
|
+
fillRule="evenodd"
|
|
24
|
+
clipRule="evenodd"
|
|
25
|
+
d="M8 11 a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"
|
|
26
|
+
/>
|
|
27
|
+
|
|
28
|
+
<path fillRule="evenodd" clipRule="evenodd" d="" />
|
|
29
|
+
</svg>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const IconModifiedDownstream = (
|
|
34
|
+
props: React.SVGProps<SVGSVGElement>,
|
|
35
|
+
) => {
|
|
36
|
+
return (
|
|
37
|
+
<svg
|
|
38
|
+
stroke="currentColor"
|
|
39
|
+
fill="currentColor"
|
|
40
|
+
strokeWidth="0"
|
|
41
|
+
viewBox="0 0 16 16"
|
|
42
|
+
height="1em"
|
|
43
|
+
width="1em"
|
|
44
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
+
{...props}
|
|
46
|
+
>
|
|
47
|
+
<path
|
|
48
|
+
fillRule="evenodd"
|
|
49
|
+
clipRule="evenodd"
|
|
50
|
+
d="M1.5 1 h13 l.5.5 v13 l-.5.5 h-13 l-.5-.5 v-13l.5-.5zM2 2v4h-1v4h1v4h4v1h4v-1h4v-4h1v-4h-1v-4h-4v-1h-4v1h-4z"
|
|
51
|
+
/>
|
|
52
|
+
<path
|
|
53
|
+
fillRule="evenodd"
|
|
54
|
+
clipRule="evenodd"
|
|
55
|
+
d="M8 11 a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"
|
|
56
|
+
/>
|
|
57
|
+
|
|
58
|
+
<path fillRule="evenodd" clipRule="evenodd" d="" />
|
|
59
|
+
</svg>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export function getIconForChangeStatus(
|
|
64
|
+
changeStatus?: "added" | "removed" | "modified",
|
|
65
|
+
isDark?: boolean,
|
|
66
|
+
): {
|
|
67
|
+
color: string;
|
|
68
|
+
hexColor: string;
|
|
69
|
+
backgroundColor: string;
|
|
70
|
+
hexBackgroundColor: string;
|
|
71
|
+
icon: typeof IconAdded | undefined;
|
|
72
|
+
} {
|
|
73
|
+
if (changeStatus === "added") {
|
|
74
|
+
const color = String(token("colors.green.solid"));
|
|
75
|
+
const backgroundColor = isDark
|
|
76
|
+
? String(token("colors.green.muted"))
|
|
77
|
+
: String(token("colors.green.subtle"));
|
|
78
|
+
return {
|
|
79
|
+
color,
|
|
80
|
+
hexColor: color,
|
|
81
|
+
backgroundColor,
|
|
82
|
+
hexBackgroundColor: backgroundColor,
|
|
83
|
+
icon: IconAdded,
|
|
84
|
+
};
|
|
85
|
+
} else if (changeStatus === "removed") {
|
|
86
|
+
const color = String(token("colors.red.solid"));
|
|
87
|
+
const backgroundColor = isDark
|
|
88
|
+
? String(token("colors.red.muted"))
|
|
89
|
+
: String(token("colors.red.subtle"));
|
|
90
|
+
return {
|
|
91
|
+
color,
|
|
92
|
+
hexColor: color,
|
|
93
|
+
backgroundColor,
|
|
94
|
+
hexBackgroundColor: backgroundColor,
|
|
95
|
+
icon: IconRemoved,
|
|
96
|
+
};
|
|
97
|
+
} else if (changeStatus === "modified") {
|
|
98
|
+
const color = String(token("colors.amber.emphasized"));
|
|
99
|
+
const backgroundColor = isDark
|
|
100
|
+
? String(token("colors.amber.emphasized"))
|
|
101
|
+
: String(token("colors.amber.subtle"));
|
|
102
|
+
return {
|
|
103
|
+
color,
|
|
104
|
+
hexColor: color,
|
|
105
|
+
backgroundColor,
|
|
106
|
+
hexBackgroundColor: backgroundColor,
|
|
107
|
+
icon: IconModified,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const color = String(token("colors.gray.focusRing"));
|
|
112
|
+
// Use theme-aware background for default state
|
|
113
|
+
const backgroundColor = isDark ? "#404040" : "#ffffff";
|
|
114
|
+
return {
|
|
115
|
+
color,
|
|
116
|
+
hexColor: color,
|
|
117
|
+
backgroundColor,
|
|
118
|
+
hexBackgroundColor: backgroundColor,
|
|
119
|
+
icon: undefined,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function getIconForResourceType(resourceType?: string): {
|
|
124
|
+
color: string;
|
|
125
|
+
icon: typeof FaCube | undefined;
|
|
126
|
+
} {
|
|
127
|
+
if (resourceType === "model") {
|
|
128
|
+
return {
|
|
129
|
+
color: String(token("colors.cyan.subtle")),
|
|
130
|
+
icon: FaCube,
|
|
131
|
+
};
|
|
132
|
+
} else if (resourceType === "metric") {
|
|
133
|
+
return {
|
|
134
|
+
color: String(token("colors.rose.subtle")),
|
|
135
|
+
icon: FaChartSimple,
|
|
136
|
+
};
|
|
137
|
+
} else if (resourceType === "source") {
|
|
138
|
+
return {
|
|
139
|
+
color: String(token("colors.green.muted")),
|
|
140
|
+
icon: FaDatabase,
|
|
141
|
+
};
|
|
142
|
+
} else if (resourceType === "exposure") {
|
|
143
|
+
return {
|
|
144
|
+
color: String(token("colors.rose.subtle")),
|
|
145
|
+
icon: FaGauge,
|
|
146
|
+
};
|
|
147
|
+
} else if (resourceType === "semantic_model") {
|
|
148
|
+
return {
|
|
149
|
+
color: String(token("colors.rose.focusRing")),
|
|
150
|
+
icon: FaCircleNodes,
|
|
151
|
+
};
|
|
152
|
+
} else if (resourceType === "seed") {
|
|
153
|
+
return {
|
|
154
|
+
color: String(token("colors.green.emphasized")),
|
|
155
|
+
icon: FaSeedling,
|
|
156
|
+
};
|
|
157
|
+
} else if (resourceType === "snapshot") {
|
|
158
|
+
return {
|
|
159
|
+
color: String(token("colors.green.emphasized")),
|
|
160
|
+
icon: FaCamera,
|
|
161
|
+
};
|
|
162
|
+
} else {
|
|
163
|
+
return { color: "inherit", icon: undefined };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
import { RunType } from "@/components/run/registry";
|
|
3
|
+
import { createLineageDiffCheck } from "@/lib/api/lineagecheck";
|
|
4
|
+
import { RowCountDiffParams, RowCountParams } from "@/lib/api/rowcount";
|
|
5
|
+
import { cancelRun, submitRun, waitRun } from "@/lib/api/runs";
|
|
6
|
+
import { createSchemaDiffCheck } from "@/lib/api/schemacheck";
|
|
7
|
+
import {
|
|
8
|
+
EXPLORE_ACTION,
|
|
9
|
+
EXPLORE_SOURCE,
|
|
10
|
+
trackExploreAction,
|
|
11
|
+
} from "@/lib/api/track";
|
|
12
|
+
import { ValueDiffParams } from "@/lib/api/valuediff";
|
|
13
|
+
import { useApiConfig } from "@/lib/hooks/ApiConfigContext";
|
|
14
|
+
import { useRecceActionContext } from "@/lib/hooks/RecceActionContext";
|
|
15
|
+
import { ActionState } from "./LineageViewContext";
|
|
16
|
+
import { LineageGraphNode } from "./lineage";
|
|
17
|
+
|
|
18
|
+
const initValue: ActionState = {
|
|
19
|
+
mode: "per_node",
|
|
20
|
+
status: "pending",
|
|
21
|
+
completed: 0,
|
|
22
|
+
total: 0,
|
|
23
|
+
actions: {},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const useMultiNodesAction = (
|
|
27
|
+
nodes: LineageGraphNode[],
|
|
28
|
+
{
|
|
29
|
+
onActionStarted,
|
|
30
|
+
onActionNodeUpdated,
|
|
31
|
+
onActionCompleted,
|
|
32
|
+
}: {
|
|
33
|
+
onActionStarted: () => void;
|
|
34
|
+
onActionNodeUpdated: (node: LineageGraphNode) => void;
|
|
35
|
+
onActionCompleted: () => void;
|
|
36
|
+
},
|
|
37
|
+
) => {
|
|
38
|
+
const { apiClient } = useApiConfig();
|
|
39
|
+
const actionState = useRef<ActionState>({
|
|
40
|
+
...initValue,
|
|
41
|
+
}).current;
|
|
42
|
+
|
|
43
|
+
const { showRunId } = useRecceActionContext();
|
|
44
|
+
|
|
45
|
+
const submitRunForNodes = async (
|
|
46
|
+
type: RunType,
|
|
47
|
+
skip: (node: LineageGraphNode) => string | undefined,
|
|
48
|
+
getParams: (
|
|
49
|
+
nodes: LineageGraphNode[],
|
|
50
|
+
) => RowCountParams | RowCountDiffParams,
|
|
51
|
+
) => {
|
|
52
|
+
actionState.mode = "multi_nodes";
|
|
53
|
+
actionState.actions = {};
|
|
54
|
+
const mode = actionState.mode;
|
|
55
|
+
const actions = actionState.actions;
|
|
56
|
+
|
|
57
|
+
onActionStarted();
|
|
58
|
+
actionState.status = "running";
|
|
59
|
+
|
|
60
|
+
const candidates: LineageGraphNode[] = [];
|
|
61
|
+
|
|
62
|
+
for (const node of nodes) {
|
|
63
|
+
const skipReason = skip(node);
|
|
64
|
+
|
|
65
|
+
if (skipReason) {
|
|
66
|
+
actions[node.id] = {
|
|
67
|
+
mode,
|
|
68
|
+
status: "skipped",
|
|
69
|
+
skipReason,
|
|
70
|
+
};
|
|
71
|
+
onActionNodeUpdated(node);
|
|
72
|
+
} else {
|
|
73
|
+
actions[node.id] = { mode, status: "pending" };
|
|
74
|
+
candidates.push(node);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const params = getParams(candidates);
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
const { run_id } = await submitRun(
|
|
82
|
+
type,
|
|
83
|
+
params,
|
|
84
|
+
{ nowait: true },
|
|
85
|
+
apiClient,
|
|
86
|
+
);
|
|
87
|
+
showRunId(run_id);
|
|
88
|
+
actionState.currentRun = { run_id };
|
|
89
|
+
actionState.total = 1;
|
|
90
|
+
|
|
91
|
+
for (;;) {
|
|
92
|
+
const run = await waitRun(run_id, 2, apiClient);
|
|
93
|
+
actionState.currentRun = run;
|
|
94
|
+
|
|
95
|
+
const status = run.error
|
|
96
|
+
? "failure"
|
|
97
|
+
: run.result
|
|
98
|
+
? "success"
|
|
99
|
+
: "running";
|
|
100
|
+
|
|
101
|
+
for (const node of candidates) {
|
|
102
|
+
actions[node.id] = {
|
|
103
|
+
mode,
|
|
104
|
+
status,
|
|
105
|
+
run,
|
|
106
|
+
};
|
|
107
|
+
onActionNodeUpdated(node);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (run.error || run.result) {
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} catch (_e) {
|
|
115
|
+
// don't need to do anything here, the error will be shown in the summary
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
actionState.completed = 1;
|
|
119
|
+
if ((actionState.status as string) === "canceling") {
|
|
120
|
+
actionState.status = "canceled";
|
|
121
|
+
onActionCompleted();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
actionState.status = "completed";
|
|
126
|
+
onActionCompleted();
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const submitRunsPerNodes = async (
|
|
130
|
+
type: RunType,
|
|
131
|
+
getParams: (node: LineageGraphNode) => {
|
|
132
|
+
/* params is the input parameters for the run of a node */
|
|
133
|
+
params?: ValueDiffParams;
|
|
134
|
+
/* skipReason is a string that explains why the node is skipped */
|
|
135
|
+
skipReason?: string;
|
|
136
|
+
},
|
|
137
|
+
) => {
|
|
138
|
+
actionState.mode = "per_node";
|
|
139
|
+
actionState.actions = {};
|
|
140
|
+
const mode = actionState.mode;
|
|
141
|
+
const actions = actionState.actions;
|
|
142
|
+
|
|
143
|
+
onActionStarted();
|
|
144
|
+
actionState.status = "running";
|
|
145
|
+
|
|
146
|
+
for (const node of nodes) {
|
|
147
|
+
actions[node.id] = { mode, status: "pending" };
|
|
148
|
+
onActionNodeUpdated(node);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
actionState.completed = 0;
|
|
152
|
+
actionState.total = nodes.length;
|
|
153
|
+
|
|
154
|
+
for (const node of nodes) {
|
|
155
|
+
const { params, skipReason } = getParams(node);
|
|
156
|
+
if (skipReason) {
|
|
157
|
+
actions[node.id] = {
|
|
158
|
+
mode,
|
|
159
|
+
status: "skipped",
|
|
160
|
+
skipReason,
|
|
161
|
+
};
|
|
162
|
+
onActionNodeUpdated(node);
|
|
163
|
+
} else {
|
|
164
|
+
try {
|
|
165
|
+
const { run_id } = await submitRun(
|
|
166
|
+
type,
|
|
167
|
+
params,
|
|
168
|
+
{ nowait: true },
|
|
169
|
+
apiClient,
|
|
170
|
+
);
|
|
171
|
+
actionState.currentRun = { run_id };
|
|
172
|
+
actions[node.id] = {
|
|
173
|
+
mode,
|
|
174
|
+
status: "running",
|
|
175
|
+
};
|
|
176
|
+
onActionNodeUpdated(node);
|
|
177
|
+
|
|
178
|
+
for (;;) {
|
|
179
|
+
const run = await waitRun(run_id, 2, apiClient);
|
|
180
|
+
actionState.currentRun = run;
|
|
181
|
+
const status = run.error
|
|
182
|
+
? "failure"
|
|
183
|
+
: run.result
|
|
184
|
+
? "success"
|
|
185
|
+
: "running";
|
|
186
|
+
actions[node.id] = {
|
|
187
|
+
mode,
|
|
188
|
+
status,
|
|
189
|
+
run,
|
|
190
|
+
};
|
|
191
|
+
onActionNodeUpdated(node);
|
|
192
|
+
|
|
193
|
+
if (run.error || run.result) {
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
} catch (_e) {
|
|
198
|
+
// don't need to do anything here, the error will be shown in the summary
|
|
199
|
+
} finally {
|
|
200
|
+
actionState.currentRun = undefined;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
actionState.completed++;
|
|
204
|
+
if ((actionState.status as string) === "canceling") {
|
|
205
|
+
actionState.status = "canceled";
|
|
206
|
+
onActionCompleted();
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
actionState.status = "completed";
|
|
212
|
+
onActionCompleted();
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const runRowCount = async () => {
|
|
216
|
+
trackExploreAction({
|
|
217
|
+
action: EXPLORE_ACTION.ROW_COUNT,
|
|
218
|
+
source: EXPLORE_SOURCE.LINEAGE_VIEW_TOP_BAR,
|
|
219
|
+
node_count: nodes.length,
|
|
220
|
+
});
|
|
221
|
+
|
|
222
|
+
const nodeNames = [];
|
|
223
|
+
for (const node of nodes) {
|
|
224
|
+
if (node.data.resourceType !== "model") {
|
|
225
|
+
actionState.actions[node.id] = {
|
|
226
|
+
mode: "multi_nodes",
|
|
227
|
+
status: "skipped",
|
|
228
|
+
skipReason: "Not a model",
|
|
229
|
+
};
|
|
230
|
+
onActionNodeUpdated(node);
|
|
231
|
+
} else {
|
|
232
|
+
nodeNames.push(node.data.name);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const skip = (node: LineageGraphNode) => {
|
|
237
|
+
if (node.data.resourceType !== "model") {
|
|
238
|
+
return "Not a model";
|
|
239
|
+
}
|
|
240
|
+
};
|
|
241
|
+
const getParams = (nodes: LineageGraphNode[]): RowCountParams => {
|
|
242
|
+
return {
|
|
243
|
+
node_names: nodes.map((node) => node.data.name),
|
|
244
|
+
};
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
await submitRunForNodes("row_count", skip, getParams);
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
const runRowCountDiff = async () => {
|
|
251
|
+
trackExploreAction({
|
|
252
|
+
action: EXPLORE_ACTION.ROW_COUNT_DIFF,
|
|
253
|
+
source: EXPLORE_SOURCE.LINEAGE_VIEW_TOP_BAR,
|
|
254
|
+
node_count: nodes.length,
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
const nodeNames = [];
|
|
258
|
+
for (const node of nodes) {
|
|
259
|
+
if (node.data.resourceType !== "model") {
|
|
260
|
+
actionState.actions[node.id] = {
|
|
261
|
+
mode: "multi_nodes",
|
|
262
|
+
status: "skipped",
|
|
263
|
+
skipReason: "Not a model",
|
|
264
|
+
};
|
|
265
|
+
onActionNodeUpdated(node);
|
|
266
|
+
} else {
|
|
267
|
+
nodeNames.push(node.data.name);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const skip = (node: LineageGraphNode) => {
|
|
272
|
+
if (node.data.resourceType !== "model") {
|
|
273
|
+
return "Not a model";
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
const getParams = (nodes: LineageGraphNode[]): RowCountDiffParams => {
|
|
277
|
+
return {
|
|
278
|
+
node_names: nodes.map((node) => node.data.name),
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
await submitRunForNodes("row_count_diff", skip, getParams);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
const runValueDiff = async () => {
|
|
286
|
+
trackExploreAction({
|
|
287
|
+
action: EXPLORE_ACTION.VALUE_DIFF,
|
|
288
|
+
source: EXPLORE_SOURCE.LINEAGE_VIEW_TOP_BAR,
|
|
289
|
+
node_count: nodes.length,
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
await submitRunsPerNodes("value_diff", (node) => {
|
|
293
|
+
const primaryKey = node.data.data.current?.primary_key;
|
|
294
|
+
if (!primaryKey) {
|
|
295
|
+
return {
|
|
296
|
+
skipReason:
|
|
297
|
+
"No primary key found. The first unique column is used as primary key.",
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
const params: ValueDiffParams = {
|
|
302
|
+
model: node.data.name,
|
|
303
|
+
primary_key: primaryKey,
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
return { params };
|
|
307
|
+
});
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
const addLineageDiffCheck = async () => {
|
|
311
|
+
const nodeIds = nodes.map((node) => node.id);
|
|
312
|
+
return await createLineageDiffCheck(
|
|
313
|
+
{
|
|
314
|
+
node_ids: nodeIds,
|
|
315
|
+
},
|
|
316
|
+
apiClient,
|
|
317
|
+
);
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
const addSchemaDiffCheck = async () => {
|
|
321
|
+
let check;
|
|
322
|
+
if (nodes.length === 1) {
|
|
323
|
+
check = await createSchemaDiffCheck({ node_id: nodes[0].id }, apiClient);
|
|
324
|
+
} else {
|
|
325
|
+
const nodeIds = nodes.map((node) => node.id);
|
|
326
|
+
check = await createSchemaDiffCheck({ node_id: nodeIds }, apiClient);
|
|
327
|
+
}
|
|
328
|
+
return check;
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
const cancel = async () => {
|
|
332
|
+
actionState.status = "canceling";
|
|
333
|
+
if (actionState.currentRun?.run_id) {
|
|
334
|
+
await cancelRun(actionState.currentRun.run_id, apiClient);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
const reset = () => {
|
|
339
|
+
Object.assign(actionState, initValue);
|
|
340
|
+
};
|
|
341
|
+
|
|
342
|
+
return {
|
|
343
|
+
actionState,
|
|
344
|
+
runRowCount,
|
|
345
|
+
runRowCountDiff,
|
|
346
|
+
runValueDiff,
|
|
347
|
+
addLineageDiffCheck,
|
|
348
|
+
addSchemaDiffCheck,
|
|
349
|
+
cancel,
|
|
350
|
+
reset,
|
|
351
|
+
};
|
|
352
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import Button from "@mui/material/Button";
|
|
3
|
+
import MuiDialog from "@mui/material/Dialog";
|
|
4
|
+
import DialogActions from "@mui/material/DialogActions";
|
|
5
|
+
import DialogContent from "@mui/material/DialogContent";
|
|
6
|
+
import DialogTitle from "@mui/material/DialogTitle";
|
|
7
|
+
import IconButton from "@mui/material/IconButton";
|
|
8
|
+
import Stack from "@mui/material/Stack";
|
|
9
|
+
import React, { useCallback, useRef, useState } from "react";
|
|
10
|
+
import { IoClose } from "react-icons/io5";
|
|
11
|
+
import {
|
|
12
|
+
EXPLORE_ACTION,
|
|
13
|
+
EXPLORE_FORM_EVENT,
|
|
14
|
+
trackExploreActionForm,
|
|
15
|
+
} from "@/lib/api/track";
|
|
16
|
+
|
|
17
|
+
function useValueDiffAlertDialog() {
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
const [nodeCount, setNodeCount] = useState(0);
|
|
20
|
+
const [resolvePromise, setResolvePromise] =
|
|
21
|
+
useState<(value: boolean) => void>();
|
|
22
|
+
const cancelRef = useRef<HTMLButtonElement>(null);
|
|
23
|
+
|
|
24
|
+
const confirm = useCallback((nodeCount: number) => {
|
|
25
|
+
setNodeCount(nodeCount);
|
|
26
|
+
return new Promise<boolean>((resolve) => {
|
|
27
|
+
setResolvePromise(() => resolve);
|
|
28
|
+
setOpen(true);
|
|
29
|
+
});
|
|
30
|
+
}, []);
|
|
31
|
+
|
|
32
|
+
const handleConfirm = () => {
|
|
33
|
+
trackExploreActionForm({
|
|
34
|
+
action: EXPLORE_ACTION.VALUE_DIFF,
|
|
35
|
+
event: EXPLORE_FORM_EVENT.EXECUTE,
|
|
36
|
+
});
|
|
37
|
+
resolvePromise?.(true);
|
|
38
|
+
setOpen(false);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const handleCancel = () => {
|
|
42
|
+
trackExploreActionForm({
|
|
43
|
+
action: EXPLORE_ACTION.VALUE_DIFF,
|
|
44
|
+
event: EXPLORE_FORM_EVENT.CANCEL,
|
|
45
|
+
});
|
|
46
|
+
resolvePromise?.(false);
|
|
47
|
+
setOpen(false);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const ValueDiffAlertDialog = (
|
|
51
|
+
<MuiDialog
|
|
52
|
+
open={open}
|
|
53
|
+
onClose={handleCancel}
|
|
54
|
+
maxWidth="md"
|
|
55
|
+
fullWidth
|
|
56
|
+
aria-labelledby="value-diff-alert-dialog-title"
|
|
57
|
+
>
|
|
58
|
+
<DialogTitle
|
|
59
|
+
id="value-diff-alert-dialog-title"
|
|
60
|
+
sx={{ fontSize: "1.125rem", fontWeight: "bold" }}
|
|
61
|
+
>
|
|
62
|
+
Value Diff on {nodeCount} nodes
|
|
63
|
+
</DialogTitle>
|
|
64
|
+
<IconButton
|
|
65
|
+
aria-label="close"
|
|
66
|
+
onClick={handleCancel}
|
|
67
|
+
sx={{
|
|
68
|
+
position: "absolute",
|
|
69
|
+
right: 8,
|
|
70
|
+
top: 8,
|
|
71
|
+
color: "grey.500",
|
|
72
|
+
}}
|
|
73
|
+
>
|
|
74
|
+
<IoClose />
|
|
75
|
+
</IconButton>
|
|
76
|
+
<DialogContent>
|
|
77
|
+
<Stack spacing="20px">
|
|
78
|
+
<Box>
|
|
79
|
+
Value diff will be executed on {nodeCount} nodes in the Lineage,
|
|
80
|
+
which can add extra costs to your bill.
|
|
81
|
+
</Box>
|
|
82
|
+
</Stack>
|
|
83
|
+
</DialogContent>
|
|
84
|
+
<DialogActions sx={{ gap: 0.5 }}>
|
|
85
|
+
<Button
|
|
86
|
+
ref={cancelRef}
|
|
87
|
+
onClick={handleCancel}
|
|
88
|
+
variant="outlined"
|
|
89
|
+
color="neutral"
|
|
90
|
+
>
|
|
91
|
+
Cancel
|
|
92
|
+
</Button>
|
|
93
|
+
<Button
|
|
94
|
+
color="iochmara"
|
|
95
|
+
variant="contained"
|
|
96
|
+
onClick={handleConfirm}
|
|
97
|
+
sx={{ ml: 1.5 }}
|
|
98
|
+
>
|
|
99
|
+
Execute
|
|
100
|
+
</Button>
|
|
101
|
+
</DialogActions>
|
|
102
|
+
</MuiDialog>
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
return { confirm, AlertDialog: ValueDiffAlertDialog };
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export default useValueDiffAlertDialog;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import Box from "@mui/material/Box";
|
|
2
|
+
import IconButton from "@mui/material/IconButton";
|
|
3
|
+
import MuiLink from "@mui/material/Link";
|
|
4
|
+
import { PropsWithChildren } from "react";
|
|
5
|
+
import { FiInfo } from "react-icons/fi";
|
|
6
|
+
import { IoClose } from "react-icons/io5";
|
|
7
|
+
import { LuExternalLink } from "react-icons/lu";
|
|
8
|
+
|
|
9
|
+
export const RecceNotification = (
|
|
10
|
+
props: PropsWithChildren<{
|
|
11
|
+
onClose: () => void;
|
|
12
|
+
align?: string;
|
|
13
|
+
}>,
|
|
14
|
+
) => {
|
|
15
|
+
return (
|
|
16
|
+
<Box
|
|
17
|
+
sx={{
|
|
18
|
+
display: "flex",
|
|
19
|
+
flex: 1,
|
|
20
|
+
minHeight: "48px",
|
|
21
|
+
m: "4px",
|
|
22
|
+
px: "16px",
|
|
23
|
+
py: "12px",
|
|
24
|
+
bgcolor: "primary.50",
|
|
25
|
+
border: "1px solid",
|
|
26
|
+
borderRadius: "4px",
|
|
27
|
+
borderColor: "primary.400",
|
|
28
|
+
alignItems: props.align ?? "center",
|
|
29
|
+
gap: "12px",
|
|
30
|
+
}}
|
|
31
|
+
>
|
|
32
|
+
<Box
|
|
33
|
+
component={FiInfo}
|
|
34
|
+
sx={{ width: "20px", height: "20px", color: "primary.900" }}
|
|
35
|
+
/>
|
|
36
|
+
{props.children}
|
|
37
|
+
<Box sx={{ flexGrow: 1 }} />
|
|
38
|
+
<IconButton size="small" onClick={props.onClose}>
|
|
39
|
+
<IoClose />
|
|
40
|
+
</IconButton>
|
|
41
|
+
</Box>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const LearnHowLink = () => {
|
|
46
|
+
return (
|
|
47
|
+
<MuiLink
|
|
48
|
+
href="https://docs.datarecce.io/get-started/#prepare-dbt-artifacts"
|
|
49
|
+
target="_blank"
|
|
50
|
+
sx={{
|
|
51
|
+
color: "primary.main",
|
|
52
|
+
fontWeight: "bold",
|
|
53
|
+
textDecoration: "underline",
|
|
54
|
+
display: "inline-flex",
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
gap: 0.5,
|
|
57
|
+
}}
|
|
58
|
+
>
|
|
59
|
+
Learn how <LuExternalLink />
|
|
60
|
+
</MuiLink>
|
|
61
|
+
);
|
|
62
|
+
};
|