Skip to content

[dagster-dbt] support newer sqlglot versions - #34098

Draft
sebfest wants to merge 1 commit into
dagster-io:masterfrom
sebfest:fix/dagster-dbt-sqlglot-compatibility
Draft

[dagster-dbt] support newer sqlglot versions#34098
sebfest wants to merge 1 commit into
dagster-io:masterfrom
sebfest:fix/dagster-dbt-sqlglot-compatibility

Conversation

@sebfest

@sebfest sebfest commented Aug 10, 2026

Copy link
Copy Markdown

Summary & Motivation

Relaxes the sqlglot upper bound in dagster-dbt so it can coexist with current acryl-datahub[dbt] releases.

The practical motivation is compatibility with the current DataHub integration. acryl-datahub 1.6.0.10, released July 5, 2026, requires sqlglot[c]==30.8.0 for its dbt extra (PyPI metadata). Keeping Dagster's <28.1.0 cap prevents dependency resolution with that version, leaving users on an older DataHub release and therefore an older DataHub API/interface.

SQLGlot 28.1.0, the first version blocked by the cap, was released on December 2, 2025 (PyPI release history). As of August 10, 2026, that version is 251 days old, while the current DataHub dbt integration requires the 30.8.0 line.

SQLGlot 28.1+ changed its optimizer/lineage behavior. Dagster was passing an optimized AST directly to sqlglot.lineage(), which can fail for CTE/join queries because optimized aliases may be strings:

AttributeError: 'str' object has no attribute 'copy'

This PR serializes the optimized AST before the lineage call, allowing SQLGlot to reparse it into the expected expression representation, then removes the <28.1.0 cap.

Breaking change: No. This relaxes the dependency constraint and preserves the existing lineage behavior while fixing compatibility with newer SQLGlot versions.

Test plan

  • Existing test_column_lineage_integration[async-duckdb-all] passes with SQLGlot 28.1.0.
  • The same test passes with SQLGlot 29.0.1.
  • SQLGlot 30.16.0 parser/optimizer/lineage smoke test passes.
  • ruff check passes.
  • uv lock --check passes.

Closes #34097

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[dagster-dbt] Relax sqlglot upper bound after fixing 28.1+ column-lineage compatibility

1 participant