In Cursor -> execute(), while running a query that contains just comment, it causes an IndexError exception
Example query>> --comment
Error: IndexError: tuple index out of range
File "/Users/sanjeevbhatt/github/python-spanner-dev/google/cloud/spanner_dbapi/parse_utils.py", line 354, in ensure_where_clause
if any(isinstance(token, sqlparse.sql.Where) for token in sqlparse.parse(sql)[0]):
Note: Go cli returns “Error: Invalid Statement”
Environment details
Python version: 3.12.4
pip version: 24.1
google-cloud-spanner version: 3.47.0
Code example
query = "--comment"
cursor.execute(query)
Stack trace
Error: IndexError: tuple index out of range
File "/Users/sanjeevbhatt/github/python-spanner-dev/google/cloud/spanner_dbapi/parse_utils.py", line 354, in ensure_where_clause
if any(isinstance(token, sqlparse.sql.Where) for token in sqlparse.parse(sql)[0]):
In Cursor -> execute(), while running a query that contains just comment, it causes an IndexError exception
Example query>> --comment Error: IndexError: tuple index out of range File "/Users/sanjeevbhatt/github/python-spanner-dev/google/cloud/spanner_dbapi/parse_utils.py", line 354, in ensure_where_clause if any(isinstance(token, sqlparse.sql.Where) for token in sqlparse.parse(sql)[0]): Note: Go cli returns “Error: Invalid Statement”
Environment details
google-cloud-spanner
version: 3.47.0Code example
query = "--comment" cursor.execute(query)
Stack trace
Error: IndexError: tuple index out of range File "/Users/sanjeevbhatt/github/python-spanner-dev/google/cloud/spanner_dbapi/parse_utils.py", line 354, in ensure_where_clause if any(isinstance(token, sqlparse.sql.Where) for token in sqlparse.parse(sql)[0]):
Thanks!