You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copying to Redshift (awswrangler.redshift.copy) fails if one of the primary key columns (primary_keys) in the table has a hyphen in its name. The CREATE TABLE statement will then fail with the following error message:
ProgrammingError: {'S': 'ERROR', 'C': '42601', 'M': 'syntax error at or near "-"', 'P': '1026', 'F': '/home/ec2-user/padb/src/pg/src/backend/parser/parser_scan.l', 'L': '732', 'R': 'yyerror'}
This is because when creating the SQL Query for this, the column names are not escaped in the PRIMARY KEY () part.
Since this is an easy fix, I'll also open a PR for this myself today.
How to Reproduce
Create a pandas data frame where one of the columns is e.g. my-column-name and then use this column in the primary_keys parameter of the awswrangler.redshift.copy method.
Expected behavior
No error and table is written.
Your project
No response
Screenshots
No response
OS
Linux
Python version
3.9
AWS SDK for pandas version
2.17.0
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
Copying to Redshift (
awswrangler.redshift.copy
) fails if one of the primary key columns (primary_keys
) in the table has a hyphen in its name. TheCREATE TABLE
statement will then fail with the following error message:This is because when creating the SQL Query for this, the column names are not escaped in the
PRIMARY KEY ()
part.Since this is an easy fix, I'll also open a PR for this myself today.
How to Reproduce
Create a pandas data frame where one of the columns is e.g.
my-column-name
and then use this column in theprimary_keys
parameter of theawswrangler.redshift.copy
method.Expected behavior
No error and table is written.
Your project
No response
Screenshots
No response
OS
Linux
Python version
3.9
AWS SDK for pandas version
2.17.0
Additional context
No response
The text was updated successfully, but these errors were encountered: