You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "darkag (via GitHub)" <gi...@apache.org> on 2023/08/03 15:41:31 UTC

[GitHub] [airflow] darkag commented on issue #32993: Error not detected in multi-statement vertica query

darkag commented on issue #32993:
URL: https://github.com/apache/airflow/issues/32993#issuecomment-1664218057

   More or less, as far as I understand the probleme, the only way to solve this problem is to modify the fetch_all_handler like this:
   
   ```python
   def cust_fetch_all_handler(cursor) -> list[tuple] | None:
           """Handler for DbApiHook.run() to return results."""
           if not hasattr(cursor, "description"):
               raise RuntimeError(
                  "The database we interact with does not support DBAPI 2.0. Use operator and "
                  "handlers that are specifically designed for your database."
               )
           if cursor.description is not None:
               to_return = cursor.fetchall()
               while cursor.nextset(): #loop on all statement result
                   cursor.fetchall()
               return to_return
           else:
               return None
   ```
   In this example I keep the first fetch_all result to return it (to not break the current behaviour). 
   
   what I don't know is how to pass this handler only for vertica since I don't know what can be the consequences of this modification for other providers. 
   
   
   


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