SameerMesiah97 commented on code in PR #61671:
URL: https://github.com/apache/airflow/pull/61671#discussion_r2785111835


##########
airflow-core/src/airflow/serialization/decoders.py:
##########
@@ -56,9 +57,10 @@
 
 def decode_relativedelta(var: dict[str, Any]) -> 
dateutil.relativedelta.relativedelta:
     """Dencode a relativedelta object."""
-    if "weekday" in var:
-        var["weekday"] = dateutil.relativedelta.weekday(*var["weekday"])
-    return dateutil.relativedelta.relativedelta(**var)
+    copy_var = deepcopy(var)
+    if "weekday" in copy_var:
+        copy_var["weekday"] = 
dateutil.relativedelta.weekday(*copy_var["weekday"])
+    return dateutil.relativedelta.relativedelta(**copy_var)

Review Comment:
   I am not sure preventing mutation of the original "weekday" object will fix 
the bug you identified. Looks like the root cause might be incomplete 
serialization of the weekday object might be the cause here. It seems like the 
second parameter for the weekday object (nth) might have not been captured 
during serialization. I understand that it's an optional parameter with a 
`None` default but it's still part of the object's identity. So this may result 
in the "weekday" object being partially resolved. 



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