developer-rpai commented on code in PR #73748:
URL: https://github.com/apache/airflow/pull/73748#discussion_r4451776585


##########
airflow-core/src/airflow/serialization/dag_version_diff.py:
##########
@@ -884,10 +884,10 @@ def _canonicalize_value(value: Any, *, path: tuple[str, 
...]) -> Any:
             value = {"name": None, **value}
             interval = value.get("interval")
             if isinstance(interval, (int, float)) and not isinstance(interval, 
bool):
-                # Diff schema v1 uses the SDK's version-2 timedelta encoding 
for legacy seconds.
+                # Diff schema v1 uses the SDK's version-3 timedelta encoding 
for legacy seconds.
                 value["interval"] = {
                     "__classname__": "datetime.timedelta",
-                    "__version__": 2,
+                    "__version__": 3,

Review Comment:
   Good catch, thanks. Pushed 6172b22: the diff now rewrites a stored v3 
timedelta node to v2 before comparing, since the payload is still total 
seconds, so a stored v2 and v3 interval no longer show up as a deadline change. 
Added a test for exactly that case.



##########
task-sdk/tests/task_sdk/serde/test_serializers.py:
##########
@@ -164,6 +164,71 @@ def test_deserialize_legacy_datetime_bare_timestamp(self):
         nested = deserialize({"moment": legacy})
         assert nested["moment"].timestamp() == moment.timestamp()
 
+    def test_naive_datetime_serde_roundtrip(self):
+        """End-to-end: a naive datetime survives a serde round-trip 
unchanged."""
+        naive = datetime.datetime(2026, 3, 15, 12, 0, 0)
+        assert deserialize(serialize(naive)) == naive
+
+    def test_naive_datetime_v3_roundtrip_independent_of_os_timezone(self, 
monkeypatch):
+        """v3 naive datetimes round-trip regardless of the process OS timezone 
(see #72635)."""
+        import os
+        import time
+
+        from airflow.sdk.serde.serializers import datetime as serde_datetime

Review Comment:
   Done, imports are at the top and the alias is gone.



-- 
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]

Reply via email to