Remove noisy log from SQL table check#31037
Conversation
A logging statement was added to the `_generate_sql_query()` function which gets called during `__init__()` and thus creates logging output every DAG parse
| self.log.info("All tests have passed") | ||
|
|
||
| def _generate_sql_query(self): | ||
| self.log.info("Partition clause: %s", self.partition_clause) |
There was a problem hiding this comment.
logging might be important for someone so I think we should move the statement calling _generate_sql_query outside init if we can or keep it but make it debug, wdyt?
There was a problem hiding this comment.
I know I added that logging line while I was debugging some templating issues so it hasn't been around long. The function call itself needs to be in __init__() so the results gets templated correctly.
This is also why I think the log line is redundant and can be safely removed: the templated partition_clause is available via the airflow UI as a rendered field so people can see it (or the lack of it). I could see an argument for logging out the full query in the execute function for a "this is what ran" vs "this is what you can see through the UI for rendered templates", but the line this PR removes doesn't seem worthwhile.
EDIT: clarified where in the airflow UI you would see the partition_clause
There was a problem hiding this comment.
Maybe change the level to debug instead? Since you added it for debugging it could be useful again.
There was a problem hiding this comment.
Fine, I've amended the log level to debug. I still don't think the line is needed, but at least it won't spam logs this way.
A logging statement was added to the
_generate_sql_query()function which gets called during__init__()and thus creates logging output every DAG parse. This removes that logging line