dkranchii commented on code in PR #70640:
URL: https://github.com/apache/airflow/pull/70640#discussion_r3696452471
##########
airflow-core/src/airflow/migrations/versions/0101_3_2_0_ui_improvements_for_deadlines.py:
##########
@@ -594,7 +594,13 @@ def _migrate_deadline_alerts() -> None:
dags_with_deadlines.add(dag_id)
deadline_alerts = dag_deadline if isinstance(dag_deadline, list)
else [dag_deadline]
- def _migrate_dag_deadlines(dag_conn: Connection) -> Iterable[str]:
+ def _migrate_dag_deadlines(
Review Comment:
@potiuk Fair point on shipped-migration hygiene. I hadn't thought about the
drift between a user's already-applied 3.2.0 source and `main` for the same
revision ID. Reverted the function signature to exactly what shipped.
One small deviation from your suggestion: ruff flags B023 at the seven reads
of `dag_id` / `serialized_dag_id` / `deadline_alerts` / `created_at` *inside*
the closure body, not on the `def` line. So a single `# noqa: B023` on the def
doesn't suppress anything, and seven per-line noqas would have added exactly
the kind of body-level noise we're trying to avoid in a shipped migration. Went
with a file-level `# ruff: noqa: B023` at the top of the module plus a short
comment explaining the invariant (closure is invoked and fully drained via
`list(_migrate_dag_deadlines(dag_conn))` inside the same iteration). Same
intent - historical body byte-identical to 3.2.0, one centralized "why safe"
explanation. Happy to switch to per-line noqas if you'd rather have it that way.
--
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]