Skip to content

Commit e9c9cfc

Browse files
author
Peng Ren
committed
Fix reserved keyword issue
1 parent 3074f49 commit e9c9cfc

File tree

7 files changed

+679
-497
lines changed

7 files changed

+679
-497
lines changed

pymongosql/sql/handler.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ def normalize_field_path(path: str) -> str:
6262
s = re.sub(r"\[\s*['\"]([^'\"]+)['\"]\s*\]", r".\1", s)
6363
# Convert numeric bracket indexes [0] -> .0
6464
s = re.sub(r"\[\s*(\d+)\s*\]", r".\1", s)
65+
# Unquote quoted identifiers in dot notation (e.g., "date" -> date)
66+
s = re.sub(r'"([^"]+)"', r"\1", s)
6567
# Collapse multiple dots and strip leading/trailing dots
6668
s = re.sub(r"\.{2,}", ".", s).strip(".")
6769
return s

0 commit comments

Comments
 (0)