Skip to content

Commit

Permalink
chore(ingest): bump sqlglot version to latest (#12696)
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Feb 22, 2025
1 parent 9759a58 commit 389a404
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@

sqlglot_lib = {
# We heavily monkeypatch sqlglot.
# Prior to the patching, we originally maintained an acryl-sqlglot fork:
# https://github.com/tobymao/sqlglot/compare/main...hsheth2:sqlglot:main?expand=1
"sqlglot[rs]==25.32.1",
# We used to maintain an acryl-sqlglot fork: https://github.com/tobymao/sqlglot/compare/main...hsheth2:sqlglot:main?expand=1
# but not longer do.
"sqlglot[rs]==26.6.0",
"patchy==2.8.0",
}

Expand Down
12 changes: 2 additions & 10 deletions metadata-ingestion/src/datahub/sql_parsing/_sqlglot_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,9 @@ class Node(sqlglot.lineage.Node):
derived_tables = [
source.expression.parent
for source in scope.sources.values()
@@ -254,6 +257,7 @@ def to_node(
if dt.comments and dt.comments[0].startswith("source: ")
}
+ c: exp.Column
for c in source_columns:
table = c.table
source = scope.sources.get(table)
@@ -281,8 +285,21 @@ def to_node(
# it means this column's lineage is unknown. This can happen if the definition of a source used in a query
# is not passed into the `sources` map.
# is unknown. This can happen if the definition of a source used in a query is not
# passed into the `sources` map.
source = source or exp.Placeholder()
+
+ subfields = []
Expand Down
6 changes: 5 additions & 1 deletion metadata-ingestion/src/datahub/utilities/unified_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@
from dataclasses import dataclass
from typing import List, Tuple

from datahub.cli.env_utils import get_boolean_env_variable

_debug_diff = get_boolean_env_variable("DATAHUB_DEBUG_DIFF_PATCHER")

logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.setLevel(logging.DEBUG if _debug_diff else logging.INFO)

_LOOKAROUND_LINES = 300

Expand Down

0 comments on commit 389a404

Please sign in to comment.