its-amann commented on code in PR #76721:
URL: https://github.com/apache/airflow/pull/76721#discussion_r4511743608


##########
providers/amazon/src/airflow/providers/amazon/aws/hooks/redshift_data.py:
##########
@@ -241,23 +241,24 @@ def get_table_primary_key(
 
         :return: Primary key columns list
         """
-        sql = f"""
+        sql = """
             select kcu.column_name
             from information_schema.table_constraints tco
                     join information_schema.key_column_usage kcu
                         on kcu.constraint_name = tco.constraint_name
                             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 kcu.table_schema = :schema
+            and kcu.table_name = :table
         """
         stmt_id = self.execute_query(
             sql=sql,
             database=database,
             cluster_identifier=cluster_identifier,
             workgroup_name=workgroup_name,
             db_user=db_user,
+            parameters=[{"name": "schema", "value": schema}, {"name": "table", 
"value": table}],

Review Comment:
   nice, thanks! since it's the same fix as my commit, mind adding 
`Co-authored-by: Aman Agnihotri <[email protected]>` to bdd320f so 
it's credited?



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