You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/06/26 17:06:39 UTC

[GitHub] [airflow] alexbonella commented on a change in pull request #16676: Sql query results with snowflake operator

alexbonella commented on a change in pull request #16676:
URL: https://github.com/apache/airflow/pull/16676#discussion_r659193226



##########
File path: airflow/hooks/dbapi.py
##########
@@ -211,8 +211,13 @@ def _run_command(self, cur, sql_statement, parameters):
         self.log.info("Running statement: %s, parameters: %s", sql_statement, parameters)
         if parameters:
             cur.execute(sql_statement, parameters)
+            res = cur.fetchall()
+            result={'sql_statement': res,'headers': list(map(lambda t: t[0], cur.description))}
+            self.log.info("Query Results: %s", result)

Review comment:
       Hi @potiuk  !! 
   
   something like that? 
   
   if parameters:
               cur.execute(sql_statement, parameters)
   
               if self.log.isEnabledFor(logging.DEBUG):
        
                   res = cur.fetchall()
                   result={'sql_statement': res,'headers': list(map(lambda t: t[0], cur.description))}
                   self.log.info("Query Results: %s", result)
   
    




-- 
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-unsubscribe@airflow.apache.org

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