ashb commented on code in PR #25471:
URL: https://github.com/apache/airflow/pull/25471#discussion_r935676644
##########
airflow/models/taskinstance.py:
##########
@@ -2631,6 +2631,15 @@ def __eq__(self, other):
return self.__dict__ == other.__dict__
return NotImplemented
+ def as_dict(self):
+ for key in self.__dict__:
+ if key in ['start_date', 'end_date']:
+ val = getattr(self, key)
+ if not val or isinstance(val, str):
+ continue
+ self.__dict__.update({key: val.isoformat()})
+ return self.__dict__
Review Comment:
This muteates `self` in place, which it shouldn't do. Please make it return
a new dict instead.
--
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]