-
-
Save dataders/9581366ecf8b2bff4e6a1988164f593d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------------------------------------- | |
KeyError Traceback (most recent call last) | |
File ~/miniforge3/envs/rsdev/lib/python3.11/site-packages/redshift_connector/core.py:1631, in Connection.execute(self, cursor, operation, vals) | |
1630 try: | |
-> 1631 ps = cache["ps"][key] | |
1632 cursor.ps = ps | |
KeyError: ('select 1 as id; select 2 as id', ()) | |
During handling of the above exception, another exception occurred: | |
ProgrammingError Traceback (most recent call last) | |
Cell In[60], line 2 | |
1 # Query a table using the Cursor | |
----> 2 redshift_connector.connect(**vals).cursor().execute("select 1 as id; select 2 as id") | |
4 records_rs = cursor["rs"].fetchall() | |
5 print(records_rs) | |
File ~/miniforge3/envs/rsdev/lib/python3.11/site-packages/redshift_connector/cursor.py:240, in Cursor.execute(self, operation, args, stream, merge_socket_read) | |
238 self._c.execute(self, "begin transaction", None) | |
239 self._c.merge_socket_read = merge_socket_read | |
--> 240 self._c.execute(self, operation, args) | |
241 except AttributeError as e: | |
242 raise e | |
File ~/miniforge3/envs/rsdev/lib/python3.11/site-packages/redshift_connector/core.py:1701, in Connection.execute(self, cursor, operation, vals) | |
1698 else: | |
1699 raise e | |
-> 1701 self.handle_messages(cursor) | |
1703 # We've got row_desc that allows us to identify what we're | |
1704 # going to get back from this statement. | |
1705 output_fc = tuple(self.redshift_types[f["type_oid"]][0] for f in ps["row_desc"]) | |
File ~/miniforge3/envs/rsdev/lib/python3.11/site-packages/redshift_connector/core.py:1969, in Connection.handle_messages(self, cursor) | |
1966 self.message_types[code](self._read(data_len - 4), cursor) | |
1968 if self.error is not None: | |
-> 1969 raise self.error | |
ProgrammingError: {'S': 'ERROR', 'C': '42601', 'M': 'cannot insert multiple commands into a prepared statement', 'F': '../src/pg/src/backend/tcop/postgres.c', 'L': '3916', 'R': 'exec_parse_message'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment