Skip to content

Commit

Permalink
[BUGFIX] Fix LegacyRow import. (#7446)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
billdirks and github-actions[bot] authored Mar 23, 2023
1 parent c32b764 commit 1bce1c2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion great_expectations/core/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,17 @@

try:
LegacyRow = sqlalchemy.engine.row.LegacyRow
except (
ImportError,
AttributeError,
): # We need to catch an AttributeError since sqlalchemy>=2 does not have LegacyRow
LegacyRow = SQLALCHEMY_NOT_IMPORTED

# This is a separate try/except than the LegacyRow one since TextClause exists in sqlalchemy 2. This means LegacyRow
# may be not importable while TextClause is.
try:
TextClause = sqlalchemy.sql.elements.TextClause
except ImportError:
LegacyRow = SQLALCHEMY_NOT_IMPORTED
TextClause = SQLALCHEMY_NOT_IMPORTED

SCHEMAS = {
Expand Down

0 comments on commit 1bce1c2

Please sign in to comment.