o-nikolas commented on code in PR #76721:
URL: https://github.com/apache/airflow/pull/76721#discussion_r4710174746


##########
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:
   +1 to always waiting: the lookup needs the result, so 
`wait_for_completion=False` can't work for it. A follow-up is fine with me. 
That follow-up could also cover `session_id` and `session_keep_alive_seconds`: 
`redshift_data_api_kwargs` is documented as kwargs for `execute_query`, which 
takes both, but `get_table_primary_key` doesn't, so an UPSERT with either one 
set fails with a `TypeError` before the lookup runs.
   
   ---
   Drafted-by: Kiro (claude-opus-5.5); reviewed by @o-nikolas before posting



-- 
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]

Reply via email to