-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
feat: allow configuring an engine context manager #30266
Conversation
# Function that computes the allowed schemas for the CSV uploads. | ||
# Allowed schemas will be a union of schemas_allowed_for_file_upload | ||
# db configuration and a result of this function. | ||
def allowed_schemas_for_csv_upload( # pylint: disable=unused-argument |
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.
I rewrote this as a function since it's easier to read and removes the lambda complaint from the linter.
65fcfb0
to
55d41b3
Compare
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.
Nice. Did grepping to check if there were some rogue create_engine
calls not going through this method and it looked squeaky cleaned.
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.
Nice!
@mistercrunch yeah, when we implemented SSH tunneling we had to consolidate all the logic in a single place. |
SUMMARY
This PR introduces a configurable context manager that wraps the
create_engine
call to analytical databases. The intended use case is to configure the Oracle driver with tenant-specific settings in a multi-tenant environment, but there are many other potential use cases for this:chroot
ing to prevent 3rd party databases drivers from accessing the filesystem (maybe using pychroot)BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Added a unit test.
ADDITIONAL INFORMATION