Skip to content

Commit

Permalink
fix subtle bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 committed Oct 25, 2023
1 parent 7656ea6 commit 68cb4f5
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions metadata-ingestion/src/datahub/utilities/sqlglot_lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,15 @@
SQL_PARSE_RESULT_CACHE_SIZE = 1000


RULES_BEFORE_TYPE_ANNOTATION = list(
itertools.takewhile(
lambda func: func != sqlglot.optimizer.annotate_types.annotate_types,
sqlglot.optimizer.optimizer.RULES,
RULES_BEFORE_TYPE_ANNOTATION: tuple = tuple(
filter(
# Skip pushdown_predicates because it sometimes throws exceptions, and we
# don't actually need it for anything.
lambda func: func.__name__ not in {"pushdown_predicates"},
itertools.takewhile(
lambda func: func != sqlglot.optimizer.annotate_types.annotate_types,
sqlglot.optimizer.optimizer.RULES,
),
)
)

Expand Down

0 comments on commit 68cb4f5

Please sign in to comment.