-
Notifications
You must be signed in to change notification settings - Fork 14.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: use sqlalchemy_url
property in get_uri
for postgresql provider
#38831
Conversation
Signed-off-by: kalyanr <kalyan.ben10@live.com>
Signed-off-by: kalyanr <kalyan.ben10@live.com>
get_uri
to return URI in sqlAlchemy URI format
@Taragolis , based on your comment here
I guess we leave the implementation of EDIT: I updated the PR according to your original comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DBApiHook.get_uri
has ambiguous and not well documented usage, so there is consideration that it might be any of the usage of this property, depends on implementations. There is 24 Hooks (±couple) right now so it turned into the hell all implementations of DBApiHook
which I guess should be more or less interface/protocol implementation rather than actual implementation, except generic things, if it even possible
The problem right now that every single change in DBApiHook
spread across many of the implementations and we do not have any tools and methods to control that.
I would rather do not mix-in introduce changes into DBApiHook and other hook in the same PR unless absolutely necessary. So I would rather create a new propery (via separate PR), describe where it could be used right now and where it could be used in the future.
After start implements into the other hooks with potential usage in particular this hook. And after it implements in many (more that 50% I guess) community supported hooks we might start use it internally in DBApiHook, e.g. obtain SA Connections, pandas dataframes and others, with backward compatible logic to the previous implementation for prevent case if hook do not implements this one and for some unknown reason it work (or not) previously. So we could reduce number of potential mistakes which spread across other hooks.
If we talk about this PR, it is not clear what at this moment it fix, new property it is fine, but there is no any description about this property and how to use it.
I understand. I will first make the updates to the
I understand. Thanks for the feedback. What I intended to do is as you described here . To have a property For now, I will separate out the PR. |
get_uri
to return URI in sqlAlchemy URI formatsqlalchemy_url
property in get_uri
for postgresql provider
@Taragolis , all tests passed. can this be merged? |
…er (apache#38831) * update get_uri * update get_uri Signed-off-by: kalyanr <kalyan.ben10@live.com> * update docstring Signed-off-by: kalyanr <kalyan.ben10@live.com> * add and use sa_uri property * update database in sa_uri * update tests * remove client_encoding from test_get_uri * use sqlalchemy_url property * add default port * update tests * update usage of ports * revert client_encoding updates --------- Signed-off-by: kalyanr <kalyan.ben10@live.com>
…er (apache#38831) * update get_uri * update get_uri Signed-off-by: kalyanr <kalyan.ben10@live.com> * update docstring Signed-off-by: kalyanr <kalyan.ben10@live.com> * add and use sa_uri property * update database in sa_uri * update tests * remove client_encoding from test_get_uri * use sqlalchemy_url property * add default port * update tests * update usage of ports * revert client_encoding updates --------- Signed-off-by: kalyanr <kalyan.ben10@live.com>
closes: #38187related : #38195
Update
get_uri
to return URI in sqlAlchemy URI format.