vincbeck commented on code in PR #76721:
URL: https://github.com/apache/airflow/pull/76721#discussion_r4710080413
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_data.py:
##########
@@ -249,15 +266,16 @@ def get_table_primary_key(
and kcu.constraint_schema = tco.constraint_schema
and kcu.constraint_name = tco.constraint_name
where tco.constraint_type = 'PRIMARY KEY'
- and kcu.table_schema = {schema}
- and kcu.table_name = {table}
+ and {schema_filter}
+ and kcu.table_name = :table
"""
stmt_id = self.execute_query(
Review Comment:
Now that this lookup works, `S3ToRedshiftOperator` passes all of
`redshift_data_api_kwargs` here. With `wait_for_completion=False`, we call
`get_statement_result` before the statement is done and the upsert fails.
Should we always wait here? We definitely can do it as a follow-up.
##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_sql.py:
##########
@@ -31,6 +31,7 @@
URL = create_engine = make_url = None # type: ignore[assignment,misc]
from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook
+from airflow.providers.amazon.aws.hooks.redshift_data import
_VISIBLE_TABLE_FILTER
Review Comment:
nit: this imports a private constant from another hook module. Can you move
it to `aws/utils/redshift.py` instead?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]