Repository navigation
[2.0] Fixes 37646: Quote literal SQL Server schema names - #37789
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
Code Review ✅ Approved 🟡 Medium riskChanging MSSQL/AzureSQL schema quoting preserves dotted names as literal identifiers; incorrect qualification could make profiler queries fail or target a different schema. Backport of the fix that preserves literal MSSQL and AzureSQL schema names such as VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Describe your changes:
Fixes #37646
The source issue was closed when #37692 merged into main; this PR delivers the same fix to
2.0.Backport #37692 to
2.0. Preserve literal MSSQL/AzureSQL schema names such assales.archiveduring sample/profiler query construction: SQLAlchemy emits[sales.archive]as one identifier and handles bracket escaping. Raw catalog values remain unchanged.Type of change:
High-level design:
Retain the original converter-registry policy: common default
None, MSSQL/AzureSQL opt in toTrue, shared ORM builder consumes the flag and preserves Snowflake behavior. Resolvecommon.pyusing the release branch's existing typing imports/type maps, and append only the intended schema tests to its existing converter suite. Preserve release-specific sampler behavior. No unrelated main type/XML/array refactors, dependencies, generated schemas or pipeline-status changes. A comparison with main and 2.1 found no missing prerequisite for this policy; existing 2.0 type and sampling limitations remain unchanged.Tests:
Use cases covered
Release base:
c2fb84d8706a2a33c3c2573c39725b394d66ecd4. Candidate:d98e56f886fd3892dc228752e26a435f6c21d3e3. Separate target-generated Python 3.11.14 environment, SQLAlchemy 2.0.57, pytest 7.0.1; dependency compatibility passed. Test processes used one worker and OMP/BLAS threads=1.Unit tests
RED: with only the four product-file changes withheld, the new tests produced 24 failures / 4 passing other-dialect controls, including both production sampler paths:
env/bin/python -m pytest ingestion/tests/unit/observability/profiler/test_converter.py -k 'literal_tsql or production_tsql or other_dialect' -n0 -qGREEN: 64 passed:
Line coverage: MSSQL/AzureSQL converter files 100%, common mapper 94.44%, shared base 90.14%. All executable changed lines covered. Whole converter directory 89%, including unchanged mappers outside this selection.
Initial broader sampling-file selection: 64 passed / 3 Datalake failures because this focused environment omits pandas; no Datalake product change. The final run selects the SQLAlchemy sampling class. Initial pytest-cov import timing understated coverage; starting coverage before pytest produced the reported measurements. Ruff 0.15.12 check/format and normal commit hooks passed; focused basedpyright using native Node returned 0 errors / 0 warnings. Broader suites/full static profile not run.
Backend integration tests
Not applicable: no Java or API changes.
Ingestion integration tests
Retained
ingestion/tests/integration/profiler/test_dynamic_sampling_mssql.py, including the eight new MSSQL/AzureSQL × ordinary/dotted schema × table/view cases. 14 tests collected; not executed against a source engine on this release candidate.Original main head
04692b2b32a1d4164f2df44bcaf95f79c413518cpassed 20 live sampler cases, 14 integration cases and four sampling/classification CLI/API table/view cases. Those historical results do not establish execution of this distinct2.0candidate. No new source-engine/full-stack run was selected for this target-preserving adaptation; broader/live release validation remains unrun. Azure-hosted authentication remains unverified.Playwright (UI) tests
Not applicable: no UI changes.
Manual testing performed
No CLI/UI or live source-engine flow ran on this release candidate. Performed target-specific pre-fix/post-fix SQL/ORM regressions, compared release APIs and reviewed every conflict/clean hunk. Raw names and exact qualified SQL are asserted by tests. The original main runtime and data were cleaned by its validation assignment; this backport created no services, ports or test databases.
UI screen recording / screenshots:
Not applicable: Python-only ingestion bug fix.
Checklist: