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 2022/02/24 22:10:20 UTC

[GitHub] [airflow] potiuk edited a comment on pull request #21764: Make dbapi inherit get_uri from connection

potiuk edited a comment on pull request #21764:
URL: https://github.com/apache/airflow/pull/21764#issuecomment-1050312924


   > I have a feeling Connection.get_uri is a "relatively" recent addition, I think added for `airflow connections export` command.
   
   Yep. It is. And I think this is simply a very straightforward manifestation of "If is is not used, it lkely does not work". 
   
   From what I looked today the "Connection" get_uri() was added in 2.0.0a. 
   And if you look closely - there is no "REAL" usage of get_uri. There is nearly no use case for it - except displaying it in the `airflow CLI` and possibly UI (which does not matter at all if it is correct or not).
   
   The only `actual` usage of get_uri - from what I see - is "get_sqlalchemy_engine"  which is actually hardly useful anyway. Getting sqlalchemy engine for a connection makes pretty much no sense. SQLAlchemy is really an ORM mapper, and when you have generic connection you have no object schema and SQLAlchemy is useless (you can instantiate an SQLAlchemy session and run a raw query - maybe - but then you can run query via DBApi's "run" method anyway). 
   
   So while we likely should keep backwards compatibility I think hardly anyone uses it or make some assumptions about it's correctness. 


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