snowflakedb / snowflakedb/snowflake-connector-python
SNOW-3379021: Mistaken regex in cursor.py
Open
@sfc-gh-snow-drivers-warsaw-dl is already working on this.
Since Apr 17, 2026.
status-triage_done
- Dominant language
- Python
- Stars
- 730
- Forks
- 574
- Avg merge
- 5h 45m
- Merged PRs (30d)
- 16
Description
Python version
All versions
Operating system and processor architecture
All operating systems and processor architectures
Installed packages
N/A
What did you do?
N/A
What did you expect to see?
Both snowflake.connector.cursor and snowflake.connector.aio._cursor have a check like this:
if re.search(";/s*$", command) is None:
command = command + "; "
The /s should probably be \s. As-is, this sticks in an extra ;
In [14]: command = 'SELECT * FROM data; '
...: if re.search(";/s*$", command) is None:
...: command = command + "; "
...: print(command)
SELECT * FROM data; ;
Contrast with this:
In [15]: command = 'SELECT * FROM data; '
...: if re.search(r";\s*$", command) is None:
...: command = command + "; "
...: print(command)
SELECT * FROM data;
Alternatively, this would do the same trick without re:
if not command.rstrip().endswith(";"):
command = command + "; "
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.