You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/02/11 18:37:50 UTC

[GitHub] [airflow] AratiNagmal commented on a change in pull request #14177: Allow AWS Operator RedshiftToS3Transfer To Run a Custom Query

AratiNagmal commented on a change in pull request #14177:
URL: https://github.com/apache/airflow/pull/14177#discussion_r574737233



##########
File path: airflow/providers/amazon/aws/transfers/redshift_to_s3.py
##########
@@ -101,6 +107,14 @@ def __init__(  # pylint: disable=too-many-arguments
         self.include_header = include_header
         self.table_as_file_name = table_as_file_name
 
+        self._select_query = None
+        if select_query:
+            self._select_query = select_query
+        elif self.schema and self.table:
+            self._select_query = f"SELECT * FROM {self.schema}.{self.table}"
+        else:
+            raise ValueError('Please provide both `schema` and `table` params or `select_query` to fetch the data.')

Review comment:
       Thank you for pointers @kaxil !




----------------------------------------------------------------
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:
users@infra.apache.org