Dev-iL commented on code in PR #52976:
URL: https://github.com/apache/airflow/pull/52976#discussion_r2281924057


##########
providers/postgres/src/airflow/providers/postgres/hooks/postgres.py:
##########
@@ -231,6 +325,11 @@ def get_df(
 
             engine = self.get_sqlalchemy_engine()
             with engine.connect() as conn:
+                if USE_PSYCOPG3:
+                    # Cast the sql to str if it's a list (handle it 
appropriately)
+                    if isinstance(sql, list):
+                        sql = "; ".join(sql)  # Or handle multiple queries 
differently
+                    return cast("PandasDataFrame", psql.read_sql(sql, 
con=conn, params=parameters, **kwargs))
                 return psql.read_sql(sql, con=conn, params=parameters, 
**kwargs)

Review Comment:
   If I understand this method correctly, the same parameters should be applied 
to all statements - so the suggestion, while perhaps a reasonable enhancement, 
is not in line with the expected functionality.



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to