kaxil commented on code in PR #28246:
URL: https://github.com/apache/airflow/pull/28246#discussion_r1047526850
##########
airflow/utils/db_cleanup.py:
##########
@@ -337,8 +337,14 @@ def run_cleanup(
:param session: Session representing connection to the metadata database.
"""
clean_before_timestamp = timezone.coerce_datetime(clean_before_timestamp)
- effective_table_names = table_names if table_names else
list(config_dict.keys())
- effective_config_dict = {k: v for k, v in config_dict.items() if k in
effective_table_names}
+ desired_table_names = set(table_names if table_names else
config_dict.keys())
+ effective_config_dict = {k: v for k, v in config_dict.items() if k in
desired_table_names}
+ effective_table_names = set(effective_config_dict.keys())
+ if desired_table_names != effective_table_names:
+ outliers = desired_table_names - effective_table_names
+ logger.warning("The following table(s) are not valid choices and will
be skipped: %s", outliers)
Review Comment:
We can probably add a unit test case for this
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]