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
Handle database URLs a bit better #1575
Conversation
I just spotted this and the typing wasn't what I expected. Is the "Any" meant to be T = TypeVar("T")
class C:
def validate_and_normalise(self, value: T) -> T: to remain compatible with some old(er) Python version? |
The typing could probably be stricter (as it almost always can be whenever you see an
would probably work, but I think the existing signature is good enough for most purposes. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-1.9 #1575 +/- ##
===============================================
+ Coverage 85.78% 85.80% +0.01%
===============================================
Files 140 140
Lines 15386 15402 +16
===============================================
+ Hits 13199 13215 +16
Misses 2187 2187 ☔ View full report in Codecov by Sentry. |
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.
LGTM
Reason for this pull request
Some downstream libraries (e.g. OWS) customise their test behaviour depending on the database configuration. They want to be able to be able to see e.g. the db username being used to connect to the database. This was not possible in the new config API if the database config was passed in as a url - Only the url was visible, forcing the client to parse the url.
Proposed changes
Note that the reverse is NOT possible because of the order in which option handlers are evaluated. However the API method
datacube.cfg.psql_url_from_config
is already provided for this use case.docs/about/whats_new.rst
for all changesN.B. This PR also updates
whats_new.rst
to be ready for an rc4 release.