generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 82
Closed
Description
Driver version
2.0.913
Redshift version
PostgreSQL 8.0.2 on i686-pc-linux-gnu
Client Operating System
Linux
Python version
3.8
Table schema
Problem description
- Expected behaviour: Redshift python driver should not throw any error for
cursor.fetchall()while executing SQL DML statements. - Actual behaviour: Redshift python driver throws ProgrammingError for
cursor.fetchall()while executing SQL DML statements.
For eg:
Run:
res_cursor.execute("create table sample_table_from_sm (col1 int);")
data = res_cursor.fetchall()
Output:
ERROR:c8e60ff5311f4a709f6ea83e092d3d4c:Error while executing query no result set
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/site-packages/redshift_connector/cursor.py", line 498, in __next__
return self._cached_rows.popleft()
IndexError: pop from an empty deque
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/conda/lib/python3.8/site-packages/**********_sql_execution/redshift/connection.py", line 61, in execute
data = res_cursor.fetchall()
File "/opt/conda/lib/python3.8/site-packages/redshift_connector/cursor.py", line 456, in fetchall
return tuple(self)
File "/opt/conda/lib/python3.8/site-packages/redshift_connector/cursor.py", line 503, in __next__
raise ProgrammingError("no result set")
redshift_connector.error.ProgrammingError: no result set
ERROR:root:Error executing SQL query:
create table sample_table_from_sm (col1 int);
no result set
P.S. the same issue occurs for an UPDATE query.
- Error message/stack trace: Attached above
- Any other details that can be helpful:
Python Driver trace logs
Reproduction code
Metadata
Metadata
Assignees
Labels
No labels