Skip to content

Add SerializedVariableInterval for deadline alerts - #71802

Open
SameerMesiah97 wants to merge 2 commits into
apache:mainfrom
SameerMesiah97:Deadline-Alerts-VariableInterval-Refinement
Open

Add SerializedVariableInterval for deadline alerts#71802
SameerMesiah97 wants to merge 2 commits into
apache:mainfrom
SameerMesiah97:Deadline-Alerts-VariableInterval-Refinement

Conversation

@SameerMesiah97

Copy link
Copy Markdown
Contributor

Description

This change is a follow-up for PR #64751 that introduces a core-side SerializedVariableInterval representation for dynamically configured deadline intervals.

VariableInterval remains the SDK-facing type used in DAG definitions, while deserialization converts it to SerializedVariableInterval for core deadline evaluation. Variable-backed interval resolution is moved to this serialized counterpart.

Rationale

Deadline references already use dedicated serialized representations to maintain a separation between SDK and core types. Providing the same representation for VariableInterval prevents the SDK dataclass from propagating beyond the deserialization boundary and allows core deadline evaluation to operate on a dedicated core-side type.

Notes

  • Variable-backed intervals now support zero and negative values to align with existing timedelta semantics, where intervals represent offsets from the deadline reference and are not required to be positive.
  • A stale comment in test_dagrun_deadline_variable_interval_stable has been updated.

Tests

Moved the existing VariableInterval.resolve() tests to SerializedVariableInterval.resolve() to reflect that interval resolution is now performed by the core-side representation.

The resolution tests cover valid Variable values, including zero and negative offsets, as well as missing and invalid Variable values.

Backwards Compatibility

VariableInterval remains the SDK-facing type for configuring dynamic deadline intervals, so existing DAG definitions continue to work unchanged.

The change only affects the internal representation after deserialization and where Variable-backed intervals are resolved. Existing timedelta intervals and serialized deadline behavior remain unchanged.

… deserialization no longer exposes SDK interval types. Move interval resolution from VariableInterval to its serialized counterpart and allow negative and zero values to preserve existing deadline offset semantics. Move the existing interval resolution tests to SerializedVariableInterval.
@SameerMesiah97
SameerMesiah97 force-pushed the Deadline-Alerts-VariableInterval-Refinement branch from 691497e to 7aa4ef0 Compare August 19, 2026 20:18
@SameerMesiah97
SameerMesiah97 marked this pull request as ready for review August 20, 2026 22:18
@SameerMesiah97
SameerMesiah97 marked this pull request as draft August 20, 2026 22:19
@SameerMesiah97
SameerMesiah97 marked this pull request as ready for review August 20, 2026 22:19
@SameerMesiah97

Copy link
Copy Markdown
Contributor Author

@amoghrajesh @ferruzzi

Hopefully, this follow-up PR should address the concerns you raised on PR #64751.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant