hkc-8010 commented on PR #70370:
URL: https://github.com/apache/airflow/pull/70370#issuecomment-5739246271
@ferruzzi Rebased onto main with #72651 in. The `session=session` is carried
forward. Since the resolution moved into a helper, the helper takes it:
```python
def resolve_deadline_alert_interval(
alert: SerializedDeadlineAlert, *, session: Session | None = None
) -> datetime.timedelta:
```
and both DagRun creation and the clear path pass theirs.
On the test, there are three, and each one goes red if the argument is
dropped (I checked by deleting it and re-running):
- `test_forwards_session_to_variable_lookup`, in a new
`tests/unit/serialization/test_decoders.py`, on the helper itself.
- `test_dagrun_deadline_variable_interval_uses_callers_session` in
`test_dagrun.py`, on the DagRun creation path. Nothing covered that before, so
this one is protecting your fix rather than mine.
-
`test_clear_task_instances_recalculates_dagrun_queued_deadlines[variable_interval]`
now asserts `Variable.get` is called with the same session object the clear is
running in, not just a non-`None` one.
One other thing the rebase turned up, since you are sequencing these. #72651
made callback decoding strict, and the clear path decodes the callback now
where before it only touched the interval. So the raw `{"path": ..., "kwargs":
{}}` dict the test fixtures stored is no longer a valid `callback_def` and two
tests failed with `Deadline callback does not name a class`. They store
`serialize(AsyncCallback(...))` now, which is what `serialized_dag` actually
writes. Worth flagging because the unresolvable-interval test kept passing
straight through that, just for the wrong reason.
@amoghrajesh agreed on the coupling, there is nothing left in this path. The
SDK import check exits clean and `generated/known_sdk_imports_in_core.txt` is
not part of the diff.
--
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]