@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,1117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file warehouseNamingConventions.test.ts
|
|
3
|
+
* @description Tests for data warehouse column naming conventions
|
|
4
|
+
*
|
|
5
|
+
* This file tests the Value Diff and Joined Query Diff result views against
|
|
6
|
+
* the various naming conventions used by different SQL data warehouses:
|
|
7
|
+
*
|
|
8
|
+
* - Snowflake: Unquoted identifiers stored as UPPERCASE, quoted identifiers preserve case
|
|
9
|
+
* - BigQuery: Column names are case-insensitive, stored as provided
|
|
10
|
+
* - Databricks: Unity Catalog stores lowercase, queries are case-insensitive
|
|
11
|
+
* - Redshift: Default case-insensitive, folded to lowercase (like PostgreSQL)
|
|
12
|
+
* - PostgreSQL: Unquoted folded to lowercase, quoted preserve case
|
|
13
|
+
*
|
|
14
|
+
* Key scenarios tested:
|
|
15
|
+
* 1. All uppercase column names (Snowflake default)
|
|
16
|
+
* 2. All lowercase column names (PostgreSQL/Redshift default)
|
|
17
|
+
* 3. Mixed case column names (quoted identifiers)
|
|
18
|
+
* 4. Case mismatch between base and current DataFrames
|
|
19
|
+
* 5. Primary keys with different casing
|
|
20
|
+
* 6. Special characters and quoted identifiers
|
|
21
|
+
* 7. Reserved words as column names
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import fc from "fast-check";
|
|
25
|
+
import { DataFrame, RowDataTypes } from "@/lib/api/types";
|
|
26
|
+
import { toDataDiffGrid } from "@/lib/dataGrid/generators/toDataDiffGrid";
|
|
27
|
+
import { toDataGrid } from "@/lib/dataGrid/generators/toDataGrid";
|
|
28
|
+
import { toValueDiffGrid } from "@/lib/dataGrid/generators/toValueDiffGrid";
|
|
29
|
+
|
|
30
|
+
// ============================================================================
|
|
31
|
+
// Mocks
|
|
32
|
+
// ============================================================================
|
|
33
|
+
|
|
34
|
+
jest.mock("ag-grid-community", () => ({
|
|
35
|
+
ModuleRegistry: {
|
|
36
|
+
registerModules: jest.fn(),
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
|
|
40
|
+
jest.mock("@/components/ui/mui", () => ({
|
|
41
|
+
Box: ({ children }: { children: React.ReactNode }) => children,
|
|
42
|
+
Flex: ({ children }: { children: React.ReactNode }) => children,
|
|
43
|
+
Icon: () => null,
|
|
44
|
+
IconButton: () => null,
|
|
45
|
+
Menu: {
|
|
46
|
+
Root: ({ children }: { children: React.ReactNode }) => children,
|
|
47
|
+
Trigger: ({ children }: { children: React.ReactNode }) => children,
|
|
48
|
+
Content: ({ children }: { children: React.ReactNode }) => children,
|
|
49
|
+
Item: ({ children }: { children: React.ReactNode }) => children,
|
|
50
|
+
ItemGroup: ({ children }: { children: React.ReactNode }) => children,
|
|
51
|
+
Positioner: ({ children }: { children: React.ReactNode }) => children,
|
|
52
|
+
},
|
|
53
|
+
Portal: ({ children }: { children: React.ReactNode }) => children,
|
|
54
|
+
Text: ({ children }: { children: React.ReactNode }) => children,
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
// ============================================================================
|
|
58
|
+
// Test Data Factories
|
|
59
|
+
// ============================================================================
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Creates a DataFrame with Snowflake-style UPPERCASE column names
|
|
63
|
+
* Simulates: CREATE TABLE test (ID INT, USER_NAME VARCHAR, ORDER_TOTAL DECIMAL)
|
|
64
|
+
*/
|
|
65
|
+
function createSnowflakeUppercaseDataFrame(data?: RowDataTypes[][]): DataFrame {
|
|
66
|
+
return {
|
|
67
|
+
columns: [
|
|
68
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
69
|
+
{ key: "USER_NAME", name: "USER_NAME", type: "text" },
|
|
70
|
+
{ key: "ORDER_TOTAL", name: "ORDER_TOTAL", type: "number" },
|
|
71
|
+
],
|
|
72
|
+
data: data ?? [
|
|
73
|
+
[1, "ALICE", 100.5],
|
|
74
|
+
[2, "BOB", 200.75],
|
|
75
|
+
],
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Creates a DataFrame with PostgreSQL/Redshift-style lowercase column names
|
|
81
|
+
* Simulates: CREATE TABLE test (id INT, user_name VARCHAR, order_total DECIMAL)
|
|
82
|
+
*/
|
|
83
|
+
function createPostgresLowercaseDataFrame(data?: RowDataTypes[][]): DataFrame {
|
|
84
|
+
return {
|
|
85
|
+
columns: [
|
|
86
|
+
{ key: "id", name: "id", type: "integer" },
|
|
87
|
+
{ key: "user_name", name: "user_name", type: "text" },
|
|
88
|
+
{ key: "order_total", name: "order_total", type: "number" },
|
|
89
|
+
],
|
|
90
|
+
data: data ?? [
|
|
91
|
+
[1, "alice", 100.5],
|
|
92
|
+
[2, "bob", 200.75],
|
|
93
|
+
],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Creates a DataFrame with quoted mixed-case column names
|
|
99
|
+
* Simulates: CREATE TABLE test ("Id" INT, "userName" VARCHAR, "OrderTotal" DECIMAL)
|
|
100
|
+
*/
|
|
101
|
+
function createQuotedMixedCaseDataFrame(data?: RowDataTypes[][]): DataFrame {
|
|
102
|
+
return {
|
|
103
|
+
columns: [
|
|
104
|
+
{ key: "Id", name: "Id", type: "integer" },
|
|
105
|
+
{ key: "userName", name: "userName", type: "text" },
|
|
106
|
+
{ key: "OrderTotal", name: "OrderTotal", type: "number" },
|
|
107
|
+
],
|
|
108
|
+
data: data ?? [
|
|
109
|
+
[1, "alice", 100.5],
|
|
110
|
+
[2, "bob", 200.75],
|
|
111
|
+
],
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Creates a DataFrame with BigQuery-style backtick column names
|
|
117
|
+
* BigQuery allows starting with numbers when quoted: `1_column`
|
|
118
|
+
*/
|
|
119
|
+
function createBigQueryStyleDataFrame(data?: RowDataTypes[][]): DataFrame {
|
|
120
|
+
return {
|
|
121
|
+
columns: [
|
|
122
|
+
{ key: "id", name: "id", type: "integer" },
|
|
123
|
+
{ key: "1_metric", name: "1_metric", type: "number" },
|
|
124
|
+
{ key: "user-name", name: "user-name", type: "text" },
|
|
125
|
+
{ key: "order total", name: "order total", type: "number" },
|
|
126
|
+
],
|
|
127
|
+
data: data ?? [
|
|
128
|
+
[1, 100, "alice", 50.5],
|
|
129
|
+
[2, 200, "bob", 75.25],
|
|
130
|
+
],
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Creates a joined DataFrame for Value Diff with UPPERCASE columns (Snowflake)
|
|
136
|
+
*/
|
|
137
|
+
function createSnowflakeValueDiffDataFrame(): DataFrame {
|
|
138
|
+
return {
|
|
139
|
+
columns: [
|
|
140
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
141
|
+
{ key: "USER_NAME", name: "USER_NAME", type: "text" },
|
|
142
|
+
{ key: "in_a", name: "in_a", type: "boolean" },
|
|
143
|
+
{ key: "in_b", name: "in_b", type: "boolean" },
|
|
144
|
+
{ key: "base__VALUE", name: "base__VALUE", type: "number" },
|
|
145
|
+
{ key: "current__VALUE", name: "current__VALUE", type: "number" },
|
|
146
|
+
],
|
|
147
|
+
data: [
|
|
148
|
+
[1, "ALICE", true, true, 100, 150], // Modified
|
|
149
|
+
[2, "BOB", true, true, 200, 200], // Unchanged
|
|
150
|
+
[3, "CHARLIE", true, false, 300, null], // Removed
|
|
151
|
+
[4, "DIANA", false, true, null, 400], // Added
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Creates a joined DataFrame for Value Diff with lowercase columns (PostgreSQL/Redshift)
|
|
158
|
+
*/
|
|
159
|
+
function createPostgresValueDiffDataFrame(): DataFrame {
|
|
160
|
+
return {
|
|
161
|
+
columns: [
|
|
162
|
+
{ key: "id", name: "id", type: "integer" },
|
|
163
|
+
{ key: "user_name", name: "user_name", type: "text" },
|
|
164
|
+
{ key: "in_a", name: "in_a", type: "boolean" },
|
|
165
|
+
{ key: "in_b", name: "in_b", type: "boolean" },
|
|
166
|
+
{ key: "base__value", name: "base__value", type: "number" },
|
|
167
|
+
{ key: "current__value", name: "current__value", type: "number" },
|
|
168
|
+
],
|
|
169
|
+
data: [
|
|
170
|
+
[1, "alice", true, true, 100, 150],
|
|
171
|
+
[2, "bob", true, true, 200, 200],
|
|
172
|
+
[3, "charlie", true, false, 300, null],
|
|
173
|
+
[4, "diana", false, true, null, 400],
|
|
174
|
+
],
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Creates a joined DataFrame with mixed in_a/in_b casing
|
|
180
|
+
* Tests case-insensitive handling of these special columns
|
|
181
|
+
*/
|
|
182
|
+
function createMixedCaseInColumnsDataFrame(): DataFrame {
|
|
183
|
+
return {
|
|
184
|
+
columns: [
|
|
185
|
+
{ key: "id", name: "id", type: "integer" },
|
|
186
|
+
{ key: "in_a", name: "in_a", type: "boolean" }, // Mixed case
|
|
187
|
+
{ key: "in_b", name: "in_b", type: "boolean" }, // Mixed case
|
|
188
|
+
{ key: "base__value", name: "base__value", type: "number" },
|
|
189
|
+
{ key: "current__value", name: "current__value", type: "number" },
|
|
190
|
+
],
|
|
191
|
+
data: [
|
|
192
|
+
[1, true, true, 100, 150],
|
|
193
|
+
[2, true, false, 200, null],
|
|
194
|
+
],
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ============================================================================
|
|
199
|
+
// Snowflake Naming Convention Tests
|
|
200
|
+
// ============================================================================
|
|
201
|
+
|
|
202
|
+
describe("Snowflake naming conventions (UPPERCASE)", () => {
|
|
203
|
+
describe("toDataGrid", () => {
|
|
204
|
+
test("handles all UPPERCASE column names", () => {
|
|
205
|
+
const df = createSnowflakeUppercaseDataFrame();
|
|
206
|
+
const result = toDataGrid(df, { primaryKeys: ["ID"] });
|
|
207
|
+
|
|
208
|
+
expect(result.rows).toHaveLength(2);
|
|
209
|
+
expect(result.columns.length).toBeGreaterThan(0);
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
test("handles UPPERCASE primary key", () => {
|
|
213
|
+
const df = createSnowflakeUppercaseDataFrame();
|
|
214
|
+
const result = toDataGrid(df, { primaryKeys: ["ID"] });
|
|
215
|
+
|
|
216
|
+
// Should find the ID column as primary key
|
|
217
|
+
expect(result.rows[0].ID).toBe(1);
|
|
218
|
+
});
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
describe("toDataDiffGrid", () => {
|
|
222
|
+
test("handles UPPERCASE columns in both base and current", () => {
|
|
223
|
+
const base = createSnowflakeUppercaseDataFrame([
|
|
224
|
+
[1, "ALICE", 100],
|
|
225
|
+
[2, "BOB", 200],
|
|
226
|
+
]);
|
|
227
|
+
const current = createSnowflakeUppercaseDataFrame([
|
|
228
|
+
[1, "ALICE", 150], // Modified
|
|
229
|
+
[2, "BOB", 200], // Unchanged
|
|
230
|
+
[3, "CHARLIE", 300], // Added
|
|
231
|
+
]);
|
|
232
|
+
|
|
233
|
+
const result = toDataDiffGrid(base, current, { primaryKeys: ["ID"] });
|
|
234
|
+
|
|
235
|
+
expect(result.rows).toHaveLength(3);
|
|
236
|
+
// Row keys are lowercased in output - check for modified status
|
|
237
|
+
// The PK value is stored directly, non-PK values are prefixed
|
|
238
|
+
const modifiedRow = result.rows.find((r) => r.ID === 1 || r.id === 1);
|
|
239
|
+
expect(modifiedRow).toBeDefined();
|
|
240
|
+
expect(modifiedRow?.__status).toBe("modified");
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
test("handles case mismatch between base (UPPERCASE) and current (lowercase)", () => {
|
|
244
|
+
const base: DataFrame = {
|
|
245
|
+
columns: [
|
|
246
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
247
|
+
{ key: "VALUE", name: "VALUE", type: "number" },
|
|
248
|
+
],
|
|
249
|
+
data: [[1, 100]],
|
|
250
|
+
};
|
|
251
|
+
const current: DataFrame = {
|
|
252
|
+
columns: [
|
|
253
|
+
{ key: "id", name: "id", type: "integer" },
|
|
254
|
+
{ key: "value", name: "value", type: "number" },
|
|
255
|
+
],
|
|
256
|
+
data: [[1, 150]],
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
// CURRENT BEHAVIOR: toDataDiffGrid does NOT support case-insensitive PK matching
|
|
260
|
+
// The PK must exist in the merged column set with exact casing
|
|
261
|
+
// This documents a limitation when comparing cross-warehouse data
|
|
262
|
+
expect(() => {
|
|
263
|
+
toDataDiffGrid(base, current, { primaryKeys: ["ID"] });
|
|
264
|
+
}).toThrow("Column ID not found");
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
describe("toValueDiffGrid", () => {
|
|
269
|
+
test("handles in_a/in_b columns", () => {
|
|
270
|
+
const df = createSnowflakeValueDiffDataFrame();
|
|
271
|
+
|
|
272
|
+
const result = toValueDiffGrid(df, ["ID"], {});
|
|
273
|
+
|
|
274
|
+
expect(result.rows).toHaveLength(4);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
test("handles UPPERCASE primary key lookup", () => {
|
|
278
|
+
const df = createSnowflakeValueDiffDataFrame();
|
|
279
|
+
|
|
280
|
+
const result = toValueDiffGrid(df, ["ID"], {});
|
|
281
|
+
|
|
282
|
+
// Verify primary key values are accessible
|
|
283
|
+
expect(result.rows.some((r) => r.ID === 1 || r.id === 1)).toBe(true);
|
|
284
|
+
});
|
|
285
|
+
});
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// ============================================================================
|
|
289
|
+
// PostgreSQL/Redshift Naming Convention Tests
|
|
290
|
+
// ============================================================================
|
|
291
|
+
|
|
292
|
+
describe("PostgreSQL/Redshift naming conventions (lowercase)", () => {
|
|
293
|
+
describe("toDataGrid", () => {
|
|
294
|
+
test("handles all lowercase column names", () => {
|
|
295
|
+
const df = createPostgresLowercaseDataFrame();
|
|
296
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
297
|
+
|
|
298
|
+
expect(result.rows).toHaveLength(2);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
test("handles snake_case column names", () => {
|
|
302
|
+
const df: DataFrame = {
|
|
303
|
+
columns: [
|
|
304
|
+
{ key: "user_id", name: "user_id", type: "integer" },
|
|
305
|
+
{ key: "first_name", name: "first_name", type: "text" },
|
|
306
|
+
{ key: "last_login_date", name: "last_login_date", type: "datetime" },
|
|
307
|
+
],
|
|
308
|
+
data: [
|
|
309
|
+
[1, "alice", "2024-01-15T10:00:00Z"],
|
|
310
|
+
[2, "bob", "2024-01-16T11:30:00Z"],
|
|
311
|
+
],
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
const result = toDataGrid(df, { primaryKeys: ["user_id"] });
|
|
315
|
+
|
|
316
|
+
expect(result.rows).toHaveLength(2);
|
|
317
|
+
});
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
describe("toDataDiffGrid", () => {
|
|
321
|
+
test("handles lowercase columns in both DataFrames", () => {
|
|
322
|
+
const base = createPostgresLowercaseDataFrame([
|
|
323
|
+
[1, "alice", 100],
|
|
324
|
+
[2, "bob", 200],
|
|
325
|
+
]);
|
|
326
|
+
const current = createPostgresLowercaseDataFrame([
|
|
327
|
+
[1, "alice", 150],
|
|
328
|
+
[2, "bob", 200],
|
|
329
|
+
]);
|
|
330
|
+
|
|
331
|
+
const result = toDataDiffGrid(base, current, { primaryKeys: ["id"] });
|
|
332
|
+
|
|
333
|
+
expect(result.rows).toHaveLength(2);
|
|
334
|
+
const modifiedRow = result.rows.find((r) => r.id === 1);
|
|
335
|
+
expect(modifiedRow?.__status).toBe("modified");
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
describe("toValueDiffGrid", () => {
|
|
340
|
+
test("handles lowercase in_a/in_b columns", () => {
|
|
341
|
+
const df = createPostgresValueDiffDataFrame();
|
|
342
|
+
|
|
343
|
+
const result = toValueDiffGrid(df, ["id"], {});
|
|
344
|
+
|
|
345
|
+
expect(result.rows).toHaveLength(4);
|
|
346
|
+
});
|
|
347
|
+
});
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
// ============================================================================
|
|
351
|
+
// Mixed Case / Quoted Identifier Tests
|
|
352
|
+
// ============================================================================
|
|
353
|
+
|
|
354
|
+
describe("Mixed case / quoted identifier conventions", () => {
|
|
355
|
+
describe("toDataGrid", () => {
|
|
356
|
+
test("handles camelCase column names", () => {
|
|
357
|
+
const df = createQuotedMixedCaseDataFrame();
|
|
358
|
+
const result = toDataGrid(df, { primaryKeys: ["Id"] });
|
|
359
|
+
|
|
360
|
+
expect(result.rows).toHaveLength(2);
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
test("handles PascalCase column names", () => {
|
|
364
|
+
const df: DataFrame = {
|
|
365
|
+
columns: [
|
|
366
|
+
{ key: "UserId", name: "UserId", type: "integer" },
|
|
367
|
+
{ key: "FirstName", name: "FirstName", type: "text" },
|
|
368
|
+
{ key: "LastName", name: "LastName", type: "text" },
|
|
369
|
+
],
|
|
370
|
+
data: [
|
|
371
|
+
[1, "Alice", "Smith"],
|
|
372
|
+
[2, "Bob", "Jones"],
|
|
373
|
+
],
|
|
374
|
+
};
|
|
375
|
+
|
|
376
|
+
const result = toDataGrid(df, { primaryKeys: ["UserId"] });
|
|
377
|
+
|
|
378
|
+
expect(result.rows).toHaveLength(2);
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
|
|
382
|
+
describe("toDataDiffGrid with case mismatch", () => {
|
|
383
|
+
test("handles base UPPERCASE vs current lowercase", () => {
|
|
384
|
+
const base: DataFrame = {
|
|
385
|
+
columns: [
|
|
386
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
387
|
+
{ key: "NAME", name: "NAME", type: "text" },
|
|
388
|
+
],
|
|
389
|
+
data: [[1, "ALICE"]],
|
|
390
|
+
};
|
|
391
|
+
const current: DataFrame = {
|
|
392
|
+
columns: [
|
|
393
|
+
{ key: "id", name: "id", type: "integer" },
|
|
394
|
+
{ key: "name", name: "name", type: "text" },
|
|
395
|
+
],
|
|
396
|
+
data: [[1, "alice"]],
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
// CURRENT BEHAVIOR: Case mismatch in columns causes PK lookup to fail
|
|
400
|
+
// This documents a limitation for cross-warehouse comparisons
|
|
401
|
+
expect(() => {
|
|
402
|
+
toDataDiffGrid(base, current, { primaryKeys: ["ID"] });
|
|
403
|
+
}).toThrow("Column ID not found");
|
|
404
|
+
});
|
|
405
|
+
|
|
406
|
+
test("handles base lowercase vs current UPPERCASE", () => {
|
|
407
|
+
const base: DataFrame = {
|
|
408
|
+
columns: [
|
|
409
|
+
{ key: "id", name: "id", type: "integer" },
|
|
410
|
+
{ key: "value", name: "value", type: "number" },
|
|
411
|
+
],
|
|
412
|
+
data: [[1, 100]],
|
|
413
|
+
};
|
|
414
|
+
const current: DataFrame = {
|
|
415
|
+
columns: [
|
|
416
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
417
|
+
{ key: "VALUE", name: "VALUE", type: "number" },
|
|
418
|
+
],
|
|
419
|
+
data: [[1, 150]],
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
// CURRENT BEHAVIOR: Case mismatch causes PK lookup to fail
|
|
423
|
+
expect(() => {
|
|
424
|
+
toDataDiffGrid(base, current, { primaryKeys: ["id"] });
|
|
425
|
+
}).toThrow("Column id not found");
|
|
426
|
+
});
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
describe("toValueDiffGrid with mixed case IN columns", () => {
|
|
430
|
+
test("handles mixed case in_a/in_b columns", () => {
|
|
431
|
+
const df = createMixedCaseInColumnsDataFrame();
|
|
432
|
+
|
|
433
|
+
const result = toValueDiffGrid(df, ["id"], {});
|
|
434
|
+
|
|
435
|
+
expect(result.rows).toHaveLength(2);
|
|
436
|
+
});
|
|
437
|
+
|
|
438
|
+
test("handles all lowercase in_a/in_b columns", () => {
|
|
439
|
+
const df: DataFrame = {
|
|
440
|
+
columns: [
|
|
441
|
+
{ key: "id", name: "id", type: "integer" },
|
|
442
|
+
{ key: "in_a", name: "in_a", type: "boolean" },
|
|
443
|
+
{ key: "in_b", name: "in_b", type: "boolean" },
|
|
444
|
+
{ key: "base__value", name: "base__value", type: "number" },
|
|
445
|
+
{ key: "current__value", name: "current__value", type: "number" },
|
|
446
|
+
],
|
|
447
|
+
data: [[1, true, true, 100, 150]],
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
const result = toValueDiffGrid(df, ["id"], {});
|
|
451
|
+
|
|
452
|
+
expect(result.rows).toHaveLength(1);
|
|
453
|
+
});
|
|
454
|
+
|
|
455
|
+
test("handles all in_a/in_b columns", () => {
|
|
456
|
+
const df: DataFrame = {
|
|
457
|
+
columns: [
|
|
458
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
459
|
+
{ key: "in_a", name: "in_a", type: "boolean" },
|
|
460
|
+
{ key: "in_b", name: "in_b", type: "boolean" },
|
|
461
|
+
{ key: "BASE__VALUE", name: "BASE__VALUE", type: "number" },
|
|
462
|
+
{ key: "CURRENT__VALUE", name: "CURRENT__VALUE", type: "number" },
|
|
463
|
+
],
|
|
464
|
+
data: [[1, true, true, 100, 150]],
|
|
465
|
+
};
|
|
466
|
+
|
|
467
|
+
const result = toValueDiffGrid(df, ["ID"], {});
|
|
468
|
+
|
|
469
|
+
expect(result.rows).toHaveLength(1);
|
|
470
|
+
});
|
|
471
|
+
});
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
// ============================================================================
|
|
475
|
+
// BigQuery / Databricks Naming Convention Tests
|
|
476
|
+
// ============================================================================
|
|
477
|
+
|
|
478
|
+
describe("BigQuery / Databricks naming conventions", () => {
|
|
479
|
+
describe("toDataGrid", () => {
|
|
480
|
+
test("handles column names starting with numbers", () => {
|
|
481
|
+
const df: DataFrame = {
|
|
482
|
+
columns: [
|
|
483
|
+
{ key: "id", name: "id", type: "integer" },
|
|
484
|
+
{ key: "1_day_avg", name: "1_day_avg", type: "number" },
|
|
485
|
+
{ key: "7_day_avg", name: "7_day_avg", type: "number" },
|
|
486
|
+
{ key: "30_day_avg", name: "30_day_avg", type: "number" },
|
|
487
|
+
],
|
|
488
|
+
data: [
|
|
489
|
+
[1, 100, 700, 3000],
|
|
490
|
+
[2, 150, 850, 3500],
|
|
491
|
+
],
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
495
|
+
|
|
496
|
+
expect(result.rows).toHaveLength(2);
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
test("handles column names with spaces (BigQuery backtick style)", () => {
|
|
500
|
+
const df = createBigQueryStyleDataFrame();
|
|
501
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
502
|
+
|
|
503
|
+
expect(result.rows).toHaveLength(2);
|
|
504
|
+
// Verify columns with spaces are accessible
|
|
505
|
+
expect(result.rows[0]["order total"]).toBe(50.5);
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
test("handles column names with hyphens", () => {
|
|
509
|
+
const df: DataFrame = {
|
|
510
|
+
columns: [
|
|
511
|
+
{ key: "id", name: "id", type: "integer" },
|
|
512
|
+
{ key: "user-name", name: "user-name", type: "text" },
|
|
513
|
+
{ key: "order-total", name: "order-total", type: "number" },
|
|
514
|
+
],
|
|
515
|
+
data: [
|
|
516
|
+
[1, "alice", 100],
|
|
517
|
+
[2, "bob", 200],
|
|
518
|
+
],
|
|
519
|
+
};
|
|
520
|
+
|
|
521
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
522
|
+
|
|
523
|
+
expect(result.rows).toHaveLength(2);
|
|
524
|
+
});
|
|
525
|
+
|
|
526
|
+
test("handles column names with special characters", () => {
|
|
527
|
+
const df: DataFrame = {
|
|
528
|
+
columns: [
|
|
529
|
+
{ key: "id", name: "id", type: "integer" },
|
|
530
|
+
{ key: "value$", name: "value$", type: "number" },
|
|
531
|
+
{ key: "_private", name: "_private", type: "text" },
|
|
532
|
+
{ key: "__dunder__", name: "__dunder__", type: "text" },
|
|
533
|
+
],
|
|
534
|
+
data: [
|
|
535
|
+
[1, 100, "private1", "dunder1"],
|
|
536
|
+
[2, 200, "private2", "dunder2"],
|
|
537
|
+
],
|
|
538
|
+
};
|
|
539
|
+
|
|
540
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
541
|
+
|
|
542
|
+
expect(result.rows).toHaveLength(2);
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
describe("toDataDiffGrid with BigQuery style columns", () => {
|
|
547
|
+
test("handles diff with column names containing spaces", () => {
|
|
548
|
+
const base = createBigQueryStyleDataFrame([
|
|
549
|
+
[1, 100, "alice", 50],
|
|
550
|
+
[2, 200, "bob", 75],
|
|
551
|
+
]);
|
|
552
|
+
const current = createBigQueryStyleDataFrame([
|
|
553
|
+
[1, 100, "alice", 60], // Modified order total
|
|
554
|
+
[2, 200, "bob", 75],
|
|
555
|
+
]);
|
|
556
|
+
|
|
557
|
+
const result = toDataDiffGrid(base, current, { primaryKeys: ["id"] });
|
|
558
|
+
|
|
559
|
+
expect(result.rows).toHaveLength(2);
|
|
560
|
+
const modifiedRow = result.rows.find((r) => r.id === 1);
|
|
561
|
+
expect(modifiedRow?.__status).toBe("modified");
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
// ============================================================================
|
|
567
|
+
// Reserved Words as Column Names Tests
|
|
568
|
+
// ============================================================================
|
|
569
|
+
|
|
570
|
+
describe("Reserved words as column names", () => {
|
|
571
|
+
test("handles SQL reserved words as column names", () => {
|
|
572
|
+
const df: DataFrame = {
|
|
573
|
+
columns: [
|
|
574
|
+
{ key: "id", name: "id", type: "integer" },
|
|
575
|
+
{ key: "select", name: "select", type: "text" },
|
|
576
|
+
{ key: "from", name: "from", type: "text" },
|
|
577
|
+
{ key: "where", name: "where", type: "text" },
|
|
578
|
+
{ key: "order", name: "order", type: "text" },
|
|
579
|
+
{ key: "group", name: "group", type: "text" },
|
|
580
|
+
],
|
|
581
|
+
data: [[1, "sel1", "from1", "where1", "order1", "group1"]],
|
|
582
|
+
};
|
|
583
|
+
|
|
584
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
585
|
+
|
|
586
|
+
expect(result.rows).toHaveLength(1);
|
|
587
|
+
});
|
|
588
|
+
|
|
589
|
+
test("handles reserved words in diff grid", () => {
|
|
590
|
+
const base: DataFrame = {
|
|
591
|
+
columns: [
|
|
592
|
+
{ key: "id", name: "id", type: "integer" },
|
|
593
|
+
{ key: "table", name: "table", type: "text" },
|
|
594
|
+
],
|
|
595
|
+
data: [[1, "old_table"]],
|
|
596
|
+
};
|
|
597
|
+
const current: DataFrame = {
|
|
598
|
+
columns: [
|
|
599
|
+
{ key: "id", name: "id", type: "integer" },
|
|
600
|
+
{ key: "table", name: "table", type: "text" },
|
|
601
|
+
],
|
|
602
|
+
data: [[1, "new_table"]],
|
|
603
|
+
};
|
|
604
|
+
|
|
605
|
+
const result = toDataDiffGrid(base, current, { primaryKeys: ["id"] });
|
|
606
|
+
|
|
607
|
+
expect(result.rows).toHaveLength(1);
|
|
608
|
+
expect(result.rows[0].__status).toBe("modified");
|
|
609
|
+
});
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
// ============================================================================
|
|
613
|
+
// Unicode and International Character Tests
|
|
614
|
+
// ============================================================================
|
|
615
|
+
|
|
616
|
+
describe("Unicode and international character column names", () => {
|
|
617
|
+
test("handles UTF-8 column names", () => {
|
|
618
|
+
const df: DataFrame = {
|
|
619
|
+
columns: [
|
|
620
|
+
{ key: "id", name: "id", type: "integer" },
|
|
621
|
+
{ key: "名前", name: "名前", type: "text" }, // Japanese "name"
|
|
622
|
+
{ key: "価格", name: "価格", type: "number" }, // Japanese "price"
|
|
623
|
+
],
|
|
624
|
+
data: [
|
|
625
|
+
[1, "田中", 1000],
|
|
626
|
+
[2, "鈴木", 2000],
|
|
627
|
+
],
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
631
|
+
|
|
632
|
+
expect(result.rows).toHaveLength(2);
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
test("handles Cyrillic column names", () => {
|
|
636
|
+
const df: DataFrame = {
|
|
637
|
+
columns: [
|
|
638
|
+
{ key: "id", name: "id", type: "integer" },
|
|
639
|
+
{ key: "имя", name: "имя", type: "text" }, // Russian "name"
|
|
640
|
+
{ key: "значение", name: "значение", type: "number" }, // Russian "value"
|
|
641
|
+
],
|
|
642
|
+
data: [
|
|
643
|
+
[1, "Алиса", 100],
|
|
644
|
+
[2, "Борис", 200],
|
|
645
|
+
],
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
649
|
+
|
|
650
|
+
expect(result.rows).toHaveLength(2);
|
|
651
|
+
});
|
|
652
|
+
|
|
653
|
+
test("handles emojis in column names (BigQuery flexible names)", () => {
|
|
654
|
+
const df: DataFrame = {
|
|
655
|
+
columns: [
|
|
656
|
+
{ key: "id", name: "id", type: "integer" },
|
|
657
|
+
{ key: "🔑key", name: "🔑key", type: "text" },
|
|
658
|
+
{ key: "💰value", name: "💰value", type: "number" },
|
|
659
|
+
],
|
|
660
|
+
data: [
|
|
661
|
+
[1, "key1", 100],
|
|
662
|
+
[2, "key2", 200],
|
|
663
|
+
],
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
667
|
+
|
|
668
|
+
expect(result.rows).toHaveLength(2);
|
|
669
|
+
});
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
// ============================================================================
|
|
673
|
+
// Primary Key Case Sensitivity Tests
|
|
674
|
+
// ============================================================================
|
|
675
|
+
|
|
676
|
+
describe("Primary key case sensitivity", () => {
|
|
677
|
+
describe("toDataDiffGrid primary key matching", () => {
|
|
678
|
+
test("matches rows when PK has same casing in both environments", () => {
|
|
679
|
+
const base: DataFrame = {
|
|
680
|
+
columns: [
|
|
681
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
682
|
+
{ key: "VALUE", name: "VALUE", type: "number" },
|
|
683
|
+
],
|
|
684
|
+
data: [[1, 100]],
|
|
685
|
+
};
|
|
686
|
+
const current: DataFrame = {
|
|
687
|
+
columns: [
|
|
688
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
689
|
+
{ key: "VALUE", name: "VALUE", type: "number" },
|
|
690
|
+
],
|
|
691
|
+
data: [[1, 150]],
|
|
692
|
+
};
|
|
693
|
+
|
|
694
|
+
const result = toDataDiffGrid(base, current, { primaryKeys: ["ID"] });
|
|
695
|
+
|
|
696
|
+
expect(result.rows).toHaveLength(1);
|
|
697
|
+
expect(result.rows[0].__status).toBe("modified");
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
test("throws when PK has different casing between environments", () => {
|
|
701
|
+
const base: DataFrame = {
|
|
702
|
+
columns: [
|
|
703
|
+
{ key: "ID", name: "ID", type: "integer" },
|
|
704
|
+
{ key: "VALUE", name: "VALUE", type: "number" },
|
|
705
|
+
],
|
|
706
|
+
data: [[1, 100]],
|
|
707
|
+
};
|
|
708
|
+
const current: DataFrame = {
|
|
709
|
+
columns: [
|
|
710
|
+
{ key: "id", name: "id", type: "integer" },
|
|
711
|
+
{ key: "value", name: "value", type: "number" },
|
|
712
|
+
],
|
|
713
|
+
data: [[1, 150]],
|
|
714
|
+
};
|
|
715
|
+
|
|
716
|
+
// CURRENT BEHAVIOR: toDataDiffGrid requires exact case match for PKs
|
|
717
|
+
expect(() => {
|
|
718
|
+
toDataDiffGrid(base, current, { primaryKeys: ["ID"] });
|
|
719
|
+
}).toThrow("Column ID not found");
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
test("handles composite primary key with same casing", () => {
|
|
723
|
+
const base: DataFrame = {
|
|
724
|
+
columns: [
|
|
725
|
+
{ key: "region", name: "region", type: "text" },
|
|
726
|
+
{ key: "product_id", name: "product_id", type: "integer" },
|
|
727
|
+
{ key: "value", name: "value", type: "number" },
|
|
728
|
+
],
|
|
729
|
+
data: [
|
|
730
|
+
["US", 1, 100],
|
|
731
|
+
["EU", 1, 200],
|
|
732
|
+
],
|
|
733
|
+
};
|
|
734
|
+
const current: DataFrame = {
|
|
735
|
+
columns: [
|
|
736
|
+
{ key: "region", name: "region", type: "text" },
|
|
737
|
+
{ key: "product_id", name: "product_id", type: "integer" },
|
|
738
|
+
{ key: "value", name: "value", type: "number" },
|
|
739
|
+
],
|
|
740
|
+
data: [
|
|
741
|
+
["US", 1, 150],
|
|
742
|
+
["EU", 1, 250],
|
|
743
|
+
],
|
|
744
|
+
};
|
|
745
|
+
|
|
746
|
+
const result = toDataDiffGrid(base, current, {
|
|
747
|
+
primaryKeys: ["region", "product_id"],
|
|
748
|
+
});
|
|
749
|
+
|
|
750
|
+
expect(result.rows).toHaveLength(2);
|
|
751
|
+
expect(result.rows.every((r) => r.__status === "modified")).toBe(true);
|
|
752
|
+
});
|
|
753
|
+
|
|
754
|
+
test("throws with composite primary key when casing differs", () => {
|
|
755
|
+
const base: DataFrame = {
|
|
756
|
+
columns: [
|
|
757
|
+
{ key: "REGION", name: "REGION", type: "text" },
|
|
758
|
+
{ key: "PRODUCT_ID", name: "PRODUCT_ID", type: "integer" },
|
|
759
|
+
{ key: "VALUE", name: "VALUE", type: "number" },
|
|
760
|
+
],
|
|
761
|
+
data: [
|
|
762
|
+
["US", 1, 100],
|
|
763
|
+
["EU", 1, 200],
|
|
764
|
+
],
|
|
765
|
+
};
|
|
766
|
+
const current: DataFrame = {
|
|
767
|
+
columns: [
|
|
768
|
+
{ key: "region", name: "region", type: "text" },
|
|
769
|
+
{ key: "product_id", name: "product_id", type: "integer" },
|
|
770
|
+
{ key: "value", name: "value", type: "number" },
|
|
771
|
+
],
|
|
772
|
+
data: [
|
|
773
|
+
["US", 1, 150],
|
|
774
|
+
["EU", 1, 250],
|
|
775
|
+
],
|
|
776
|
+
};
|
|
777
|
+
|
|
778
|
+
// CURRENT BEHAVIOR: Case mismatch causes validation to fail
|
|
779
|
+
expect(() => {
|
|
780
|
+
toDataDiffGrid(base, current, {
|
|
781
|
+
primaryKeys: ["REGION", "PRODUCT_ID"],
|
|
782
|
+
});
|
|
783
|
+
}).toThrow("Column REGION not found");
|
|
784
|
+
});
|
|
785
|
+
});
|
|
786
|
+
});
|
|
787
|
+
|
|
788
|
+
// ============================================================================
|
|
789
|
+
// Property-Based Tests for Naming Conventions
|
|
790
|
+
// ============================================================================
|
|
791
|
+
|
|
792
|
+
describe("Property-based tests: naming convention resilience", () => {
|
|
793
|
+
/**
|
|
794
|
+
* Arbitrary for different casing styles
|
|
795
|
+
*/
|
|
796
|
+
const casingStyleArb = fc.constantFrom(
|
|
797
|
+
"lowercase",
|
|
798
|
+
"UPPERCASE",
|
|
799
|
+
"camelCase",
|
|
800
|
+
"PascalCase",
|
|
801
|
+
"snake_case",
|
|
802
|
+
"SCREAMING_SNAKE_CASE",
|
|
803
|
+
);
|
|
804
|
+
|
|
805
|
+
/**
|
|
806
|
+
* Transform a column name to a specific casing style
|
|
807
|
+
*/
|
|
808
|
+
function transformCase(name: string, style: string): string {
|
|
809
|
+
switch (style) {
|
|
810
|
+
case "lowercase":
|
|
811
|
+
return name.toLowerCase();
|
|
812
|
+
case "UPPERCASE":
|
|
813
|
+
return name.toUpperCase();
|
|
814
|
+
case "camelCase":
|
|
815
|
+
return name.charAt(0).toLowerCase() + name.slice(1);
|
|
816
|
+
case "PascalCase":
|
|
817
|
+
return name.charAt(0).toUpperCase() + name.slice(1);
|
|
818
|
+
case "snake_case":
|
|
819
|
+
return name
|
|
820
|
+
.toLowerCase()
|
|
821
|
+
.replace(/([A-Z])/g, "_$1")
|
|
822
|
+
.toLowerCase();
|
|
823
|
+
case "SCREAMING_SNAKE_CASE":
|
|
824
|
+
return name
|
|
825
|
+
.toUpperCase()
|
|
826
|
+
.replace(/([a-z])([A-Z])/g, "$1_$2")
|
|
827
|
+
.toUpperCase();
|
|
828
|
+
default:
|
|
829
|
+
return name;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* Creates a DataFrame with the specified casing style
|
|
835
|
+
*/
|
|
836
|
+
function createDataFrameWithCasing(
|
|
837
|
+
style: string,
|
|
838
|
+
numRows: number,
|
|
839
|
+
): DataFrame {
|
|
840
|
+
const columns = ["id", "name", "value"].map((col) => ({
|
|
841
|
+
key: transformCase(col, style),
|
|
842
|
+
name: transformCase(col, style),
|
|
843
|
+
type: (col === "id"
|
|
844
|
+
? "integer"
|
|
845
|
+
: col === "value"
|
|
846
|
+
? "number"
|
|
847
|
+
: "text") as DataFrame["columns"][number]["type"],
|
|
848
|
+
}));
|
|
849
|
+
|
|
850
|
+
const data: RowDataTypes[][] = Array.from({ length: numRows }, (_, i) => [
|
|
851
|
+
i + 1,
|
|
852
|
+
`item${i + 1}`,
|
|
853
|
+
(i + 1) * 100,
|
|
854
|
+
]);
|
|
855
|
+
|
|
856
|
+
return { columns, data };
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
test("toDataGrid handles any casing style consistently", () => {
|
|
860
|
+
fc.assert(
|
|
861
|
+
fc.property(casingStyleArb, fc.nat({ max: 5 }), (style, numRows) => {
|
|
862
|
+
const df = createDataFrameWithCasing(style, numRows + 1);
|
|
863
|
+
const pkColumn = df.columns[0].key;
|
|
864
|
+
|
|
865
|
+
const result = toDataGrid(df, { primaryKeys: [pkColumn] });
|
|
866
|
+
|
|
867
|
+
return result.rows.length === df.data.length;
|
|
868
|
+
}),
|
|
869
|
+
{ numRuns: 50 },
|
|
870
|
+
);
|
|
871
|
+
});
|
|
872
|
+
|
|
873
|
+
test("toDataDiffGrid handles same casing in both DataFrames", () => {
|
|
874
|
+
fc.assert(
|
|
875
|
+
fc.property(casingStyleArb, fc.nat({ max: 3 }), (style, numRows) => {
|
|
876
|
+
const base = createDataFrameWithCasing(style, numRows + 1);
|
|
877
|
+
const current = createDataFrameWithCasing(style, numRows + 1);
|
|
878
|
+
const pkColumn = base.columns[0].key;
|
|
879
|
+
|
|
880
|
+
const result = toDataDiffGrid(base, current, {
|
|
881
|
+
primaryKeys: [pkColumn],
|
|
882
|
+
});
|
|
883
|
+
|
|
884
|
+
// Result should contain rows from both base and current
|
|
885
|
+
return result.rows.length >= 0;
|
|
886
|
+
}),
|
|
887
|
+
{ numRuns: 50 },
|
|
888
|
+
);
|
|
889
|
+
});
|
|
890
|
+
|
|
891
|
+
test("column names with random casing don't cause crashes", () => {
|
|
892
|
+
fc.assert(
|
|
893
|
+
fc.property(
|
|
894
|
+
fc.array(fc.boolean(), { minLength: 10, maxLength: 10 }),
|
|
895
|
+
(casings) => {
|
|
896
|
+
// Generate column name with random character casing
|
|
897
|
+
const columnName = "columnname"
|
|
898
|
+
.split("")
|
|
899
|
+
.map((c, i) => (casings[i] ? c.toUpperCase() : c.toLowerCase()))
|
|
900
|
+
.join("");
|
|
901
|
+
|
|
902
|
+
const df: DataFrame = {
|
|
903
|
+
columns: [
|
|
904
|
+
{ key: "id", name: "id", type: "integer" },
|
|
905
|
+
{ key: columnName, name: columnName, type: "text" },
|
|
906
|
+
],
|
|
907
|
+
data: [[1, "value"]],
|
|
908
|
+
};
|
|
909
|
+
|
|
910
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
911
|
+
|
|
912
|
+
return result.rows.length === 1;
|
|
913
|
+
},
|
|
914
|
+
),
|
|
915
|
+
{ numRuns: 100 },
|
|
916
|
+
);
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
// ============================================================================
|
|
921
|
+
// Edge Cases: Column Name Collisions
|
|
922
|
+
// ============================================================================
|
|
923
|
+
|
|
924
|
+
describe("Column name edge cases", () => {
|
|
925
|
+
test("handles columns that differ only in case (edge case)", () => {
|
|
926
|
+
// This is a problematic case for some warehouses
|
|
927
|
+
// In reality, most warehouses don't allow this
|
|
928
|
+
const df: DataFrame = {
|
|
929
|
+
columns: [
|
|
930
|
+
{ key: "id", name: "id", type: "integer" },
|
|
931
|
+
{ key: "Value", name: "Value", type: "number" },
|
|
932
|
+
{ key: "value", name: "value", type: "text" }, // Same name, different case
|
|
933
|
+
],
|
|
934
|
+
data: [[1, 100, "text"]],
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
// This test documents behavior - may throw or deduplicate
|
|
938
|
+
try {
|
|
939
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
940
|
+
expect(result.rows).toHaveLength(1);
|
|
941
|
+
} catch (e) {
|
|
942
|
+
// Expected - duplicate column names should be rejected
|
|
943
|
+
expect(e).toBeDefined();
|
|
944
|
+
}
|
|
945
|
+
});
|
|
946
|
+
|
|
947
|
+
test("rejects empty column names", () => {
|
|
948
|
+
const df: DataFrame = {
|
|
949
|
+
columns: [
|
|
950
|
+
{ key: "id", name: "id", type: "integer" },
|
|
951
|
+
{ key: "", name: "", type: "text" },
|
|
952
|
+
],
|
|
953
|
+
data: [[1, "empty"]],
|
|
954
|
+
};
|
|
955
|
+
|
|
956
|
+
// Empty column names are rejected by validation (correct behavior)
|
|
957
|
+
expect(() => {
|
|
958
|
+
toDataGrid(df, { primaryKeys: ["id"] });
|
|
959
|
+
}).toThrow(/invalid 'key'/);
|
|
960
|
+
});
|
|
961
|
+
|
|
962
|
+
test("handles very long column names", () => {
|
|
963
|
+
const longName = "a".repeat(255); // Snowflake max is 255
|
|
964
|
+
|
|
965
|
+
const df: DataFrame = {
|
|
966
|
+
columns: [
|
|
967
|
+
{ key: "id", name: "id", type: "integer" },
|
|
968
|
+
{ key: longName, name: longName, type: "text" },
|
|
969
|
+
],
|
|
970
|
+
data: [[1, "value"]],
|
|
971
|
+
};
|
|
972
|
+
|
|
973
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
974
|
+
|
|
975
|
+
expect(result.rows).toHaveLength(1);
|
|
976
|
+
});
|
|
977
|
+
|
|
978
|
+
test("handles column names with trailing/leading spaces", () => {
|
|
979
|
+
const df: DataFrame = {
|
|
980
|
+
columns: [
|
|
981
|
+
{ key: "id", name: "id", type: "integer" },
|
|
982
|
+
{ key: " name ", name: " name ", type: "text" },
|
|
983
|
+
{ key: "value ", name: "value ", type: "number" },
|
|
984
|
+
{ key: " count", name: " count", type: "integer" },
|
|
985
|
+
],
|
|
986
|
+
data: [[1, "test", 100, 5]],
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
const result = toDataGrid(df, { primaryKeys: ["id"] });
|
|
990
|
+
|
|
991
|
+
expect(result.rows).toHaveLength(1);
|
|
992
|
+
});
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
// ============================================================================
|
|
996
|
+
// Cross-Warehouse Migration Scenario Tests
|
|
997
|
+
// ============================================================================
|
|
998
|
+
|
|
999
|
+
describe("Cross-warehouse migration scenarios", () => {
|
|
1000
|
+
describe("Snowflake to PostgreSQL migration", () => {
|
|
1001
|
+
test("works when columns are normalized to same casing", () => {
|
|
1002
|
+
// Simulates normalizing Snowflake UPPERCASE to lowercase before comparison
|
|
1003
|
+
const base: DataFrame = {
|
|
1004
|
+
columns: [
|
|
1005
|
+
{ key: "user_id", name: "user_id", type: "integer" },
|
|
1006
|
+
{ key: "first_name", name: "first_name", type: "text" },
|
|
1007
|
+
{ key: "last_name", name: "last_name", type: "text" },
|
|
1008
|
+
{ key: "total_orders", name: "total_orders", type: "integer" },
|
|
1009
|
+
],
|
|
1010
|
+
data: [
|
|
1011
|
+
[1, "ALICE", "SMITH", 10],
|
|
1012
|
+
[2, "BOB", "JONES", 5],
|
|
1013
|
+
],
|
|
1014
|
+
};
|
|
1015
|
+
|
|
1016
|
+
const current: DataFrame = {
|
|
1017
|
+
columns: [
|
|
1018
|
+
{ key: "user_id", name: "user_id", type: "integer" },
|
|
1019
|
+
{ key: "first_name", name: "first_name", type: "text" },
|
|
1020
|
+
{ key: "last_name", name: "last_name", type: "text" },
|
|
1021
|
+
{ key: "total_orders", name: "total_orders", type: "integer" },
|
|
1022
|
+
],
|
|
1023
|
+
data: [
|
|
1024
|
+
[1, "alice", "smith", 12],
|
|
1025
|
+
[2, "bob", "jones", 7],
|
|
1026
|
+
],
|
|
1027
|
+
};
|
|
1028
|
+
|
|
1029
|
+
const result = toDataDiffGrid(base, current, {
|
|
1030
|
+
primaryKeys: ["user_id"],
|
|
1031
|
+
});
|
|
1032
|
+
|
|
1033
|
+
// Both rows should be detected as modified (different values)
|
|
1034
|
+
expect(result.rows).toHaveLength(2);
|
|
1035
|
+
expect(result.rows.every((r) => r.__status === "modified")).toBe(true);
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
test("throws when UPPERCASE base vs lowercase current without normalization", () => {
|
|
1039
|
+
const base: DataFrame = {
|
|
1040
|
+
columns: [
|
|
1041
|
+
{ key: "USER_ID", name: "USER_ID", type: "integer" },
|
|
1042
|
+
{ key: "FIRST_NAME", name: "FIRST_NAME", type: "text" },
|
|
1043
|
+
],
|
|
1044
|
+
data: [[1, "ALICE"]],
|
|
1045
|
+
};
|
|
1046
|
+
|
|
1047
|
+
const current: DataFrame = {
|
|
1048
|
+
columns: [
|
|
1049
|
+
{ key: "user_id", name: "user_id", type: "integer" },
|
|
1050
|
+
{ key: "first_name", name: "first_name", type: "text" },
|
|
1051
|
+
],
|
|
1052
|
+
data: [[1, "alice"]],
|
|
1053
|
+
};
|
|
1054
|
+
|
|
1055
|
+
// CURRENT BEHAVIOR: Cross-warehouse case mismatch requires normalization
|
|
1056
|
+
expect(() => {
|
|
1057
|
+
toDataDiffGrid(base, current, { primaryKeys: ["USER_ID"] });
|
|
1058
|
+
}).toThrow("Column USER_ID not found");
|
|
1059
|
+
});
|
|
1060
|
+
});
|
|
1061
|
+
|
|
1062
|
+
describe("BigQuery to Redshift migration", () => {
|
|
1063
|
+
test("works when columns are normalized to same casing", () => {
|
|
1064
|
+
// Simulates normalizing BigQuery camelCase to lowercase before comparison
|
|
1065
|
+
const base: DataFrame = {
|
|
1066
|
+
columns: [
|
|
1067
|
+
{ key: "userid", name: "userid", type: "integer" },
|
|
1068
|
+
{ key: "firstname", name: "firstname", type: "text" },
|
|
1069
|
+
{ key: "ordercount", name: "ordercount", type: "integer" },
|
|
1070
|
+
],
|
|
1071
|
+
data: [
|
|
1072
|
+
[1, "Alice", 10],
|
|
1073
|
+
[2, "Bob", 5],
|
|
1074
|
+
],
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
const current: DataFrame = {
|
|
1078
|
+
columns: [
|
|
1079
|
+
{ key: "userid", name: "userid", type: "integer" },
|
|
1080
|
+
{ key: "firstname", name: "firstname", type: "text" },
|
|
1081
|
+
{ key: "ordercount", name: "ordercount", type: "integer" },
|
|
1082
|
+
],
|
|
1083
|
+
data: [
|
|
1084
|
+
[1, "Alice", 12],
|
|
1085
|
+
[2, "Bob", 7],
|
|
1086
|
+
],
|
|
1087
|
+
};
|
|
1088
|
+
|
|
1089
|
+
const result = toDataDiffGrid(base, current, { primaryKeys: ["userid"] });
|
|
1090
|
+
|
|
1091
|
+
expect(result.rows).toHaveLength(2);
|
|
1092
|
+
});
|
|
1093
|
+
|
|
1094
|
+
test("throws when camelCase base vs lowercase current without normalization", () => {
|
|
1095
|
+
const base: DataFrame = {
|
|
1096
|
+
columns: [
|
|
1097
|
+
{ key: "userId", name: "userId", type: "integer" },
|
|
1098
|
+
{ key: "firstName", name: "firstName", type: "text" },
|
|
1099
|
+
],
|
|
1100
|
+
data: [[1, "Alice"]],
|
|
1101
|
+
};
|
|
1102
|
+
|
|
1103
|
+
const current: DataFrame = {
|
|
1104
|
+
columns: [
|
|
1105
|
+
{ key: "userid", name: "userid", type: "integer" },
|
|
1106
|
+
{ key: "firstname", name: "firstname", type: "text" },
|
|
1107
|
+
],
|
|
1108
|
+
data: [[1, "Alice"]],
|
|
1109
|
+
};
|
|
1110
|
+
|
|
1111
|
+
// CURRENT BEHAVIOR: Case mismatch requires normalization
|
|
1112
|
+
expect(() => {
|
|
1113
|
+
toDataDiffGrid(base, current, { primaryKeys: ["userId"] });
|
|
1114
|
+
}).toThrow("Column userId not found");
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
});
|