FanatoniQ commented on PR #25430:
URL: https://github.com/apache/airflow/pull/25430#issuecomment-1202526975

   > @FanatoniQ I don't get it. You're saying that  
   > 
   > > Sqlalchemy's implementation of returns_rows is simply like they say on 
the documentation : cursor.description is not None.
   > 
   > But in this PR you're changing `if cursor.returns_rows:` to `if 
cursor.description is not None:`
   
   The sqlalchemy's implementation of `returns_rows` is correct, like the 
documentation says sqlalchemy's underlying implementation is 
`cursor.description is not None`.
   
   The fact is that in `DbApiHook.run` uses stock driver connections and not 
sqlalchemy. To be clearer if you change `fetch_all_handler` to add a strong 
runtime type check like so: `if not isinstance(cursor, 
sqlalchemy.engine.CursorResult): raise AttributeError("the cursor isn't an  
sqlalchemy cursor")` it will fail with the error.


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