Skip to content

Commit 08d22ba

Browse files
committed
feat: explore dbt Core 1.12 v2 parser support (fixes #770)
- add dbt-core 1.12.0 + dbt-core-experimental-parser>=2.0.0a5 dev dep - add v2-parser-tests CI job (blocking, push/PR only) - add 13 xfail tests: parse, compile, build, docs generate, adapter features - add devops/scripts/compare_manifests.py for v1 vs v2 manifest diffing - add docs/contributing/v2-parser.md with finding: sqlserver not yet supported - add make v2-parser-test target Finding: v2 parser rejects type=sqlserver in profiles.yml. All tests xfail strict=True -- will auto-pass when upstream adds sqlserver adapter support.
1 parent 9df1c91 commit 08d22ba

12 files changed

Lines changed: 1009 additions & 3 deletions

File tree

.github/workflows/integration-tests-sqlserver.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on: # yamllint disable-line rule:truthy
99
paths:
1010
- 'dbt/**'
1111
- 'tests/functional/**'
12+
- 'tests/functional/adapter/v2_parser/**'
1213
- 'devops/**'
1314
- 'docker-compose.yml'
1415
- '**/*.lock'
@@ -23,6 +24,7 @@ on: # yamllint disable-line rule:truthy
2324
paths:
2425
- 'dbt/**'
2526
- 'tests/functional/**'
27+
- 'tests/functional/adapter/v2_parser/**'
2628
- 'devops/**'
2729
- 'docker-compose.yml'
2830
- '**/*.lock'
@@ -132,3 +134,53 @@ jobs:
132134
DBT_TEST_USER_3: DBT_TEST_USER_3
133135
SQLSERVER_TEST_DRIVER: "ODBC Driver ${{ matrix.msodbc_version }} for SQL Server"
134136
SQLSERVER_TEST_BACKEND: ${{ matrix.backend }}
137+
138+
v2-parser-tests:
139+
name: V2 Parser / Py${{ matrix.python_version }} / ${{ matrix.backend }} / SQL${{ matrix.sqlserver_version }} / ODBC${{ matrix.msodbc_version }}
140+
if: github.event_name != 'schedule' && github.actor != 'dependabot[bot]'
141+
strategy:
142+
fail-fast: false
143+
matrix:
144+
python_version: ["3.13"]
145+
backend: [pyodbc]
146+
sqlserver_version: ["2025"]
147+
msodbc_version: ["18"]
148+
collation: [SQL_Latin1_General_CP1_CI_AS]
149+
runs-on: ubuntu-latest
150+
container:
151+
image: ghcr.io/${{ github.repository }}:CI-${{ matrix.python_version }}-${{ matrix.backend == 'pyodbc' && format('msodbc{0}', matrix.msodbc_version) || 'mssql' }}
152+
credentials:
153+
username: ${{ github.actor }}
154+
password: ${{ secrets.GITHUB_TOKEN }}
155+
services:
156+
sqlserver:
157+
image: ghcr.io/${{ github.repository }}:server-${{ matrix.sqlserver_version }}
158+
env:
159+
ACCEPT_EULA: 'Y'
160+
SA_PASSWORD: 5atyaNadella
161+
DBT_TEST_USER_1: DBT_TEST_USER_1
162+
DBT_TEST_USER_2: DBT_TEST_USER_2
163+
DBT_TEST_USER_3: DBT_TEST_USER_3
164+
COLLATION: ${{ matrix.collation }}
165+
steps:
166+
- uses: actions/checkout@v7
167+
168+
- name: Install uv
169+
run: pip install uv
170+
171+
- name: Install dependencies
172+
env:
173+
INSTALL_EXTRA: ${{ matrix.backend == 'pyodbc' && 'pyodbc' || 'mssql' }}
174+
run: uv pip install --system -e ".[$INSTALL_EXTRA]" --group dev
175+
176+
- name: Install dbt-core-experimental-parser
177+
run: uv pip install --system dbt-core-experimental-parser
178+
179+
- name: Run v2 parser tests
180+
run: pytest -n auto -ra -v tests/functional/adapter/v2_parser --profile "ci_sql_server"
181+
env:
182+
DBT_TEST_USER_1: DBT_TEST_USER_1
183+
DBT_TEST_USER_2: DBT_TEST_USER_2
184+
DBT_TEST_USER_3: DBT_TEST_USER_3
185+
SQLSERVER_TEST_DRIVER: "ODBC Driver ${{ matrix.msodbc_version }} for SQL Server"
186+
SQLSERVER_TEST_BACKEND: ${{ matrix.backend }}

CONTRIBUTING.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ All CI/CD pipelines are using GitHub Actions. The following pipelines are availa
106106

107107
* `publish-docker`: publishes the image we use in all other pipelines.
108108
* `unit-tests`: runs the unit tests for each supported Python version.
109-
* `integration-tests-sqlserver`: runs the integration tests for SQL Server.
109+
* `integration-tests-sqlserver`: runs the integration tests for SQL Server (includes the `v2-parser-tests` job).
110110
* `release-version`: publishes the adapter to PyPI.
111111

112112
There is an additional [Pre-commit](https://pre-commit.ci/) pipeline that validates the code style.
@@ -131,3 +131,7 @@ Make sure the version number is bumped in `dbt/adapters/sqlserver/__version__.py
131131
A GitHub Actions workflow will be triggered to build the package and push it to PyPI.
132132

133133
If you're releasing support for a new version of `dbt-core`, also bump the `dbt-core` constraint in `dependencies` in `pyproject.toml`.
134+
135+
## V2 Parser (Experimental)
136+
137+
See [docs/contributing/v2-parser.md](docs/contributing/v2-parser.md) for details on the experimental Rust-based v2 parser, local setup, CI integration, known limitations, and manifest comparison.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ functional: ## Runs functional tests.
4343
@\
4444
uv run pytest -n $(THREADS) -ra -v tests/functional
4545

46+
.PHONY: v2-parser-test
47+
v2-parser-test: ## Runs v2 parser functional tests. Requires dbt-core-experimental-parser on PATH and a running SQL Server.
48+
@\
49+
uv run pytest -m v2_parser tests/functional/adapter/v2_parser -v
50+
4651
.PHONY: test
4752
test: ## Runs unit tests and code checks against staged changes.
4853
@status=0; \

0 commit comments

Comments
 (0)