potiuk commented on code in PR #27912:
URL: https://github.com/apache/airflow/pull/27912#discussion_r1032331484


##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -264,22 +291,26 @@ def run(
 
             with closing(conn.cursor()) as cur:
                 results = []
-                for sql_statement in sql:
+                for sql_statement in sql_list:
                     self._run_command(cur, sql_statement, parameters)
 
                     if handler is not None:
                         result = handler(cur)
-                        results.append(result)
-                self.last_description = cur.description
+                        if has_scalar_return_value(sql, return_last, 
split_statements):
+                            results = [result]

Review Comment:
   We do not need to append value - only last is used anyway when scalar return 
value is used.



##########
airflow/providers/common/sql/hooks/sql.py:
##########
@@ -264,22 +291,26 @@ def run(
 
             with closing(conn.cursor()) as cur:
                 results = []
-                for sql_statement in sql:
+                for sql_statement in sql_list:
                     self._run_command(cur, sql_statement, parameters)
 
                     if handler is not None:
                         result = handler(cur)
-                        results.append(result)
-                self.last_description = cur.description
+                        if has_scalar_return_value(sql, return_last, 
split_statements):
+                            results = [result]

Review Comment:
   We do not need to append results - only last is used anyway when scalar 
return value is used.



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