Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[dagster-dbt] support newer sqlglot versions
  • Loading branch information
sebfest committed Aug 10, 2026
commit 1580e0d54c961b3c013f8c570ab2a05563e274e2
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ def _build_column_lineage_metadata(
dialect=sql_dialect,
),
)
# SQLGlot 28.1+ expects aliases in a reparsed expression to be Expression
# objects. Serializing the optimized AST avoids a compatibility issue where
# optimized CTE/join aliases are strings.
optimized_node_sql = optimized_node_ast.sql(dialect=sql_dialect)

# 2. Retrieve the column names from the current node.
schema_column_names = {column.lower() for column in event_history_metadata.columns.keys()}
Expand Down Expand Up @@ -176,7 +180,7 @@ def _build_column_lineage_metadata(
column_deps: set[TableColumnDep] = set()
for sqlglot_lineage_node in lineage(
column=column_name,
sql=optimized_node_ast,
sql=optimized_node_sql,
schema=sqlglot_mapping_schema,
dialect=sql_dialect,
).walk():
Expand Down
2 changes: 1 addition & 1 deletion python_modules/libraries/dagster-dbt/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies = [
"orjson",
"requests",
"rich",
"sqlglot[rs]<28.1.0", # FW-731
"sqlglot[rs]",
"typer>=0.9.0",
"packaging",
]
Expand Down
Loading