-
Notifications
You must be signed in to change notification settings - Fork 46
feat: support global OS prefix #922
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -305,9 +305,12 @@ async def setup_dependency_overrides( | |
| ) | ||
|
|
||
| # --- OS databases --- | ||
| os_global_prefix = FactorySettings().os_global_prefix | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you can create a variable to encapsulate a |
||
| for db_name, conn_kwargs in BaseOSDB.available_urls().items(): | ||
| os_db_classes = BaseOSDB.available_implementations(db_name) | ||
| os_db = os_db_classes[0](connection_kwargs=conn_kwargs) | ||
| os_db = os_db_classes[0]( | ||
| connection_kwargs=conn_kwargs, global_prefix=os_global_prefix | ||
| ) | ||
| await stack.enter_async_context(os_db.client_context()) | ||
| for os_db_class in os_db_classes: | ||
| overrides[os_db_class.session] = partial(_db_context, os_db) | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How complex would it be to add a unit test against the mock OS DB? |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file seems unexpected 🥲 |
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.
From what I understand, the prefix must be lower case.