pankajastro commented on code in PR #32319:
URL: https://github.com/apache/airflow/pull/32319#discussion_r1421437350


##########
airflow/providers/databricks/hooks/databricks_sql.py:
##########
@@ -240,6 +240,13 @@ def run(
         else:
             return results
 
+    @staticmethod
+    def _make_serializable(result):
+        """Transform the databricks Row objects into a JSON-serializable list 
of rows."""
+        if result is not None:
+            return [list(row) for row in result]

Review Comment:
   Hey @Joffreybvn  I feel If the handler callable returns non-iterable then 
this would fail. 
   
   I call the run method like below and it's breaking my DAG
   ```
   run( f"SELECT COUNT(*) FROM {table}", handler=lambda x: x.fetchone())
   ```
   
   **Error**
   ```
   packages/airflow/providers/databricks/hooks/databricks_sql.py", line 247, in 
<listcomp>
       return [list(row) for row in result]
   TypeError: 'int' object is not iterable
   ```
   



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