Repository navigation
Commit 2c67329
committed
fix(dialect): make extend_sqlglot idempotent
_override saved whatever was currently installed under _<name>, so a second
extend_sqlglot() call saved the override itself as the original. The wrapper
then called itself and every subsequent type/CAST parse raised RecursionError,
with sqlglot's original method lost.
_override now returns early when the override is already installed.
Adds tests/core/test_dialect.py::test_extend_sqlglot_is_idempotent, which fails
with RecursionError without the fix.
Signed-off-by: Sanjay Santhanam <51058514+Sanjays2402@users.noreply.github.com>1 parent e91c9b9 commit 2c67329
2 files changed
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
782 | 782 | | |
783 | 783 | | |
784 | 784 | | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
785 | 789 | | |
786 | 790 | | |
787 | 791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1185 | 1185 | | |
1186 | 1186 | | |
1187 | 1187 | | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
0 commit comments