Skip to content

Commit

Permalink
Merge pull request #1996 from moj-analytical-services/bug/older-sqlgl…
Browse files Browse the repository at this point in the history
…ot-compatibility

sqlglot.parse_one - use read keyword argument
  • Loading branch information
ADBond authored Feb 23, 2024
2 parents e978948 + 6997ff5 commit dd2df28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- Bug that prevented `sqlglot <= 17.0.0` from working properly ([#1996](https://github.com/moj-analytical-services/splink/pull/1996))

## [3.9.12] - 2024-01-30

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions splink/input_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def add_quotes_to_column_name(input_str, q_s, q_e):

# If the raw string parses to a valid signature, use it
try:
tree = sqlglot.parse_one(input_str, dialect=sqlglot_dialect)
tree = sqlglot.parse_one(input_str, read=sqlglot_dialect)
except (sqlglot.ParseError, sqlglot.TokenError):
pass
else:
Expand All @@ -123,7 +123,7 @@ def add_quotes_to_column_name(input_str, q_s, q_e):
q_s, q_e = _get_dialect_quotes(sqlglot_dialect)
input_str = add_quotes_to_column_name(input_str, q_s, q_e)
try:
tree = sqlglot.parse_one(input_str, dialect=sqlglot_dialect)
tree = sqlglot.parse_one(input_str, read=sqlglot_dialect)
except (sqlglot.ParseError, sqlglot.TokenError):
pass
else:
Expand Down

0 comments on commit dd2df28

Please sign in to comment.