Eason09053360 commented on code in PR #74243:
URL: https://github.com/apache/airflow/pull/74243#discussion_r4190868124
##########
airflow-core/src/airflow/utils/db_cleanup.py:
##########
@@ -354,9 +354,9 @@ def readable_config(self):
config_dict: dict[str, _TableConfig] = {x.table_name: x for x in
sorted(config_list)}
-def _check_for_rows(*, session: Session, query: Select, print_rows: bool =
False) -> int:
+def _check_for_rows(*, session: Session, query: Select, table_name: str,
print_rows: bool = False) -> int:
num_entities =
session.scalars(select(func.count()).select_from(query.subquery())).one()
- print(f"Found {num_entities} rows meeting deletion criteria.")
+ print(f"Found {num_entities} rows in table {table_name} meeting deletion
criteria.")
Review Comment:
Nit: with exactly one matching row the output now reads `Found 1 rows in
table dag_run meeting deletion criteria.` and then `Deleted 1 row from
dag_run.` This PR already edits that line, so could it use the same label?
```suggestion
row_label = "row" if num_entities == 1 else "rows"
print(f"Found {num_entities} {row_label} in table {table_name} meeting
deletion criteria.")
```
--
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]