-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add parameter to turn off SQL query logging #24570
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
Conversation
potiuk
left a comment
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.
Some user documentation would be handy,
potiuk
left a comment
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.
user docs missing
|
@potiuk updated! |
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
|
@uranusjr updated |
tests/hooks/test_dbapi.py
Outdated
| return conn | ||
|
|
||
| self.db_hook = UnitTestDbApiHook() | ||
| self.db_hook_log_sql = UnitTestDbApiHook(log_sql=False) |
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.
| self.db_hook_log_sql = UnitTestDbApiHook(log_sql=False) | |
| self.db_hook_no_log_sql = UnitTestDbApiHook(log_sql=False) |
This should be clearer? But since this is only used by one test, it’s better to simply instantiate the hook in that test instead.
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.
@uranusjr Sure, I can rename it. I instantiate the hook here because UnitTestDbApiHook is defined here, I could pull it out perhaps? Also db_hook_schema_override is only used in one test and defined here, so I kept that pattern.
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.
A lot of the provider tests are historically suboptimally written, they don’t always serve as good style guides 🙂
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
closes: #11618
DbApiHookacceptslog_sqlkwarg to turn off logging the SQL query. InBaseSQLOperator,hook_kwargsflows through to the hook, includinglog_sql.