bolkedebruin commented on PR #29355:
URL: https://github.com/apache/airflow/pull/29355#issuecomment-1422478049

   > In order to achieve the goal of constructing TaskInstance objects from 
"task" and "dict" could we have constructor of TaskInstance extended to support 
new parameter, e.g. task_dict like this:
   > 
   > def __init__(
   >     self,
   >     task: Operator,
   >     execution_date: datetime | None = None,
   >     run_id: str | None = None,
   >     state: str | None = None,
   >     map_index: int = -1,
   >     task_dict: dict = None,
   > ):
   >     if task_dict is not None:
   >         # init from task_dict
   >         return
   > 
   >     # old implementation
   > 
   > and then TaskInstance(task=t), TaskInstance(task_dict={...})
   > 
   > What do you think about this approach?
   
   I don't that makes sense, a staticmethod or classmethod `deserialize` should 
cover this.


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