aws-sdk-pandas icon indicating copy to clipboard operation
aws-sdk-pandas copied to clipboard

Unable to use copy_from_files to load into a redshift table w/ an identity column.

Open nlm4145 opened this issue 8 months ago • 1 comments

Describe the bug

In reference to this issue, it appears we are still unable to run copy_from_files when attempting to copy parquet data into a redshift table that has an identity column. It works with to_sql, but not copy_from_files.

How to Reproduce

*P.S. Please do not attach files as it's considered a security risk. Add code snippets directly in the message body as much as possible.*
  1. Upload parquet data into S3
  2. Create a table with an Identity column for said file
  3. run awswrangler.redshift.copy_from_files() to copy the file into the target table. This will return the error:

redshift_connector.error.ProgrammingError: {'S': 'ERROR', 'C': '42601', 'M': 'NOT NULL column without DEFAULT must be included in column list', 'F': '../src/pg/src/backend/commands/commands_copy.c', 'L': '2836', 'R': 'DoTheCopy'}

Expected behavior

Expected the copy query to succeed and the resulting table to contain the same data as the parquet file, with the identity column auto-incrementing.

Your project

No response

Screenshots

No response

OS

Linux

Python version

3.11.7

AWS SDK for pandas version

3.8.0

Additional context

No response

nlm4145 avatar Jun 24 '24 16:06 nlm4145