Skip to content

Commit

Permalink
Fixes S3ToRedshift COPY query (#10436)
Browse files Browse the repository at this point in the history
* fix: 馃悰 Wrong S3 URI on COPY query

The S3 URI on COPY query was appending the target Redshift table to the
S3 object key.

* test: 馃拲 Fixed typo on test query

The COPY query that the operator used is the same query the test uses.
  • Loading branch information
gmontanola committed Aug 22, 2020
1 parent 0c4f7cd commit c635804
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airflow/providers/amazon/aws/transfers/s3_to_redshift.py
Expand Up @@ -96,7 +96,7 @@ def execute(self, context):

copy_query = """
COPY {schema}.{table}
FROM 's3://{s3_bucket}/{s3_key}/{table}'
FROM 's3://{s3_bucket}/{s3_key}'
with credentials
'aws_access_key_id={access_key};aws_secret_access_key={secret_key}'
{copy_options};
Expand Down
Expand Up @@ -55,7 +55,7 @@ def test_execute(self, mock_run, mock_session):

copy_query = """
COPY {schema}.{table}
FROM 's3://{s3_bucket}/{s3_key}/{table}'
FROM 's3://{s3_bucket}/{s3_key}'
with credentials
'aws_access_key_id={access_key};aws_secret_access_key={secret_key}'
{copy_options};
Expand Down

0 comments on commit c635804

Please sign in to comment.