uranusjr commented on code in PR #69073:
URL: https://github.com/apache/airflow/pull/69073#discussion_r3510838708
##########
airflow-core/src/airflow/models/deadline.py:
##########
@@ -242,30 +242,25 @@ def get_simple_context():
return {
"dag_run":
DAGRunResponse.model_validate(dagrun).model_dump(mode="json"),
- "deadline": {"id": self.id, "deadline_time":
self.deadline_time},
+ "deadline": {"id": str(self.id), "deadline_time":
self.deadline_time},
}
if isinstance(self.callback, TriggererCallback):
- # Update the callback with context before queuing
- if "kwargs" not in self.callback.data:
- self.callback.data["kwargs"] = {}
- self.callback.data["kwargs"] = (self.callback.data.get("kwargs")
or {}) | {
- "context": get_simple_context()
+ self.callback.data = self.callback.data | {
+ "kwargs": (self.callback.data.get("kwargs") or {}) |
{"context": get_simple_context()},
}
Review Comment:
It’s probably personal style but personally I don’t like this. Simple `if`
is better IMO.
If you insist, `|=` is easier than `... = ... | ...`.
--
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]