You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bolkedebruin (via GitHub)" <gi...@apache.org> on 2023/02/08 11:56:35 UTC

[GitHub] [airflow] bolkedebruin commented on pull request #29355: AIP-44 Support TaskInstance serialization/deserialization.

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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org