zhongjiajie commented on a change in pull request #7688: [AIRFLOW-6794] Allow
AWS Operator RedshiftToS3Transfer To Run a Custom Query
URL: https://github.com/apache/airflow/pull/7688#discussion_r390707156
##########
File path: airflow/providers/amazon/aws/operators/redshift_to_s3.py
##########
@@ -107,7 +112,12 @@ def execute(self, context):
credentials = s3_hook.get_credentials()
unload_options = '\n\t\t\t'.join(self.unload_options)
s3_key = '{}/{}_'.format(self.s3_key, self.table) if
self.table_as_file_name else self.s3_key
- select_query = "SELECT * FROM
{schema}.{table}".format(schema=self.schema, table=self.table)
+ if self.custom_select_query is None:
+ if self.schema is None or self.table is None:
+ raise AirflowBadRequest("schema, table set to None")
Review comment:
I think is better to use `Both custom_select_query and (schema, table) be
None not allow here` or some else, you could not just hint with `schema` and
`table`
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services