sohailshk commented on code in PR #76721:
URL: https://github.com/apache/airflow/pull/76721#discussion_r4512362983
##########
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:
Of course, added you as co-author in e6f4c09. Thanks for spotting it!
--
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]