Fix: Handle SQLAlchemy_URI for Vertica Provider#55928
Conversation
|
Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide (https://github.com/apache/airflow/blob/main/contributing-docs/README.rst)
|
Lee-W
left a comment
There was a problem hiding this comment.
mostly looks good. a few nitpicks
|
Hi @jason810496, just following up on this PR. Please let me know if you have any questions or if there's anything else you need from me. Thanks! |
jason810496
left a comment
There was a problem hiding this comment.
Hi Piyush, I saw your message on Slack.
Thanks for the reminder!
It seems there are still some comments from Wei that have not yet been resolved.
LGTM after addressing those comments, and please don't hesitate to resolve the comments yourself.
Thanks!
|
Sure i will do that. |
|
Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions. |
* fix: vertica sqlalchemy uri * Fix: add newline at end of 38195.bugfix.rst to pass pre-commit hooks * Fix: Deleted the bugfix * Added the annotations * adjusting the format for mocks * Changed the Mock Format
Summary
This PR resolves a issue where the
VerticaHookin theapache-airflow-providers-verticapackage failed to correctly construct a SQLAlchemy connection URI. The previous implementation, which relied on the defaultDbApiHook.get_uri()method, was unable to properly handle complex connection parameters, especially those provided in theextrafield of the Airflow Connection.This change introduces a new
sqlalchemy_urlproperty within theVerticaHook. This property now correctly parses all connection attributes, including thehost,port,login,password,schema(database), and most importantly, any key-value pairs from theextrafield. Theget_uri()method is updated to return a valid string representation of this URL object, ensuring that the hook can reliably connect to Vertica databases using a correctly formed SQLAlchemy URI.Related Issues
Related #38195 (Specifically, the Vertica portion of this issue)
Checklist
mainbranch.prekand all checks passed.