-
-
Notifications
You must be signed in to change notification settings - Fork 298
Closed
Description
While upgrading to Python 3.12, a SyntaxWarning is raised due to an invalid escape sequence in bigquery_view_parser.py (line 1715).
Issue
Python 3.12 treats invalid escape sequences as SyntaxWarning instead of DeprecationWarning. Reference: Python 3.12 documentation.
The following line contains an invalid escape sequence:
REGEXP_REPLACE(title, r'\s+', '_') AS regexp_title, revisions
\s is treated as an invalid escape sequence.
Proposed Fix
To resolve this issue, update the line in one of the following ways:
-
Use a raw string (Recommended for regex patterns), make the whole query into raw string.
-
Escape the backslash explicitly:
REGEXP_REPLACE(title, r'\\s+', '_') AS regexp_title, revisions
Would appreciate if this fix could be merged to prevent issues in projects using pyparsing with Python 3.12. Let me know if any additional details are needed.
Thanks! 🚀
ptmcg
Metadata
Metadata
Assignees
Labels
No labels