SameerMesiah97 commented on code in PR #71802:
URL: https://github.com/apache/airflow/pull/71802#discussion_r3866621716
##########
airflow-core/src/airflow/serialization/decoders.py:
##########
@@ -203,16 +204,19 @@ def decode_deadline_alert(encoded_data: dict):
"from a version that supports VariableInterval. Downgrade is not
fully reversible."
)
- interval: datetime.timedelta | VariableInterval
+ interval: datetime.timedelta | SerializedVariableInterval
# Backward compatibility: previously interval was stored as
total_seconds() (float/int).
# Handle numeric values by converting to timedelta.
if isinstance(raw_interval, (int, float)):
interval = datetime.timedelta(seconds=raw_interval)
else:
deserialized = deserialize(raw_interval)
- if isinstance(deserialized, (datetime.timedelta, VariableInterval)):
+
+ if isinstance(deserialized, datetime.timedelta):
interval = deserialized
+ elif isinstance(deserialized, VariableInterval):
+ interval = SerializedVariableInterval(key=deserialized.key)
else:
Review Comment:
The new branch for `SerializedVariableInterval ` has been added. The test
`test_serialize_deserialize_deadline_alert` has been parametrized with test
cases for `timedelta`, `VariableInterval` and `SerializedVariableInterval`
resolution.
--
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]