You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "potiuk (via GitHub)" <gi...@apache.org> on 2023/09/03 17:01:17 UTC
[GitHub] [airflow] potiuk commented on a diff in pull request #33837: Refactor unneeded 'continue' jumps in models
potiuk commented on code in PR #33837:
URL: https://github.com/apache/airflow/pull/33837#discussion_r1314289102
##########
airflow/models/taskinstance.py:
##########
@@ -2966,12 +2966,9 @@ def as_dict(self):
stacklevel=2,
)
new_dict = dict(self.__dict__)
- for key in new_dict:
- if key in ["start_date", "end_date"]:
- val = new_dict[key]
- if not val or isinstance(val, str):
- continue
- new_dict.update({key: val.isoformat()})
+ for key, val in new_dict.items():
+ if key in ["start_date", "end_date"] and isinstance(val, datetime):
Review Comment:
I think this is not exactly the same. We can have pendulum datetime here as well.
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org