ashb commented on a change in pull request #21551:
URL: https://github.com/apache/airflow/pull/21551#discussion_r806664890



##########
File path: airflow/providers/postgres/operators/postgres.py
##########
@@ -60,10 +61,17 @@ def __init__(
         self.autocommit = autocommit
         self.parameters = parameters
         self.database = database
+        self.runtime_parameters = runtime_parameters
         self.hook: Optional[PostgresHook] = None
 
     def execute(self, context: 'Context'):
         self.hook = PostgresHook(postgres_conn_id=self.postgres_conn_id, 
schema=self.database)
+        if self.runtime_parameters:
+            set_param_sql = [f"SET {param} TO '{val}'; " for param, val in 
self.runtime_parameters.items()]

Review comment:
       This feels prone to SQL injection. We should use SQLAlchemy constructs 
here to ensure we are not.




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