airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRFLOW-2247) Fix RedshiftToS3Transfer not to fail with ValueError
Date Mon, 26 Mar 2018 19:27:00 GMT

    [ https://issues.apache.org/jira/browse/AIRFLOW-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16414413#comment-16414413
] 

ASF subversion and git services commented on AIRFLOW-2247:
----------------------------------------------------------

Commit 9b42fc9a1a036a63aeec22a7c7ab310447b376f2 in incubator-airflow's branch refs/heads/master
from [~sekikn]
[ https://git-wip-us.apache.org/repos/asf?p=incubator-airflow.git;h=9b42fc9 ]

[AIRFLOW-2247] Fix RedshiftToS3Transfer not to fail with ValueError

RedshiftToS3Transfer calls
S3Hook.get_credentials() and tries
to take the return value as a tuple with two
elements but fails.
This is because the return value is
ReadOnlyCredentials, which
should be handled as a single object or a tuple
with tree elements.
This PR fixes the above problem.

Closes #3158 from sekikn/AIRFLOW-2247


> Fix RedshiftToS3Transfer not to fail with ValueError
> ----------------------------------------------------
>
>                 Key: AIRFLOW-2247
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-2247
>             Project: Apache Airflow
>          Issue Type: Bug
>          Components: aws, redshift
>            Reporter: Kengo Seki
>            Assignee: Kengo Seki
>            Priority: Major
>             Fix For: 2.0.0
>
>
> I tried to use RedshiftToS3Transfer but it failed with:
> {code}
> /path/to/incubator-airflow/airflow/operators/redshift_to_s3_operator.py in execute(self,
context)
>      69         self.hook = PostgresHook(postgres_conn_id=self.redshift_conn_id)
>      70         self.s3 = S3Hook(aws_conn_id=self.aws_conn_id)
> ---> 71         a_key, s_key = self.s3.get_credentials()
>      72         unload_options = '\n\t\t\t'.join(self.unload_options)
>      73 
> ValueError: too many values to unpack
> {code}
> This is occurred by unmatch between the number of variables and return values. As AwsHook.get_credentials'
docstring says, it returns three values:
> {code}
>     def get_credentials(self, region_name=None):
>         """Get the underlying `botocore.Credentials` object.
>         This contains the attributes: access_key, secret_key and token.
>         """
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message