You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/06/22 05:59:54 UTC
[GitHub] [airflow] uranusjr commented on a diff in pull request #24570: Add parameter to turn off SQL query logging
uranusjr commented on code in PR #24570:
URL: https://github.com/apache/airflow/pull/24570#discussion_r903312616
##########
airflow/hooks/dbapi.py:
##########
@@ -56,6 +56,7 @@ class DbApiHook(BaseHook):
:param schema: Optional DB schema that overrides the schema specified in the connection. Make sure that
if you change the schema parameter value in the constructor of the derived Hook, such change
should be done before calling the ``DBApiHook.__init__()``.
+ :param log_sql: Whether to log SQL query during `run`. Defaults to True.
Review Comment:
```suggestion
:param log_sql: Whether to log SQL query when it's executed. Defaults to *True*.
```
##########
airflow/hooks/dbapi.py:
##########
@@ -69,7 +70,7 @@ class DbApiHook(BaseHook):
# Override with db-specific query to check connection
_test_connection_sql = "select 1"
- def __init__(self, *args, schema: Optional[str] = None, **kwargs):
+ def __init__(self, *args, schema: Optional[str] = None, log_sql: Optional[bool] = True, **kwargs):
Review Comment:
Why not `log_sql: bool = True`?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org