potiuk commented on a change in pull request #21731:
URL: https://github.com/apache/airflow/pull/21731#discussion_r820698689
##########
File path: airflow/models/taskinstance.py
##########
@@ -2394,24 +2394,89 @@ class SimpleTaskInstance:
Used to send data between processes via Queues.
"""
- def __init__(self, ti: TaskInstance):
- self._dag_id: str = ti.dag_id
- self._task_id: str = ti.task_id
- self._run_id: str = ti.run_id
- self._start_date: datetime = ti.start_date
- self._end_date: datetime = ti.end_date
- self._try_number: int = ti.try_number
- self._state: str = ti.state
- self._executor_config: Any = ti.executor_config
+ def __init__(
+ self,
+ dag_id: str,
+ task_id: str,
+ run_id: str,
+ start_date: datetime,
+ end_date: datetime,
+ try_number: int,
+ state: str,
+ executor_config: Any,
+ pool: str,
+ queue: str,
+ key: TaskInstanceKey,
+ run_as_user: Optional[str] = None,
+ priority_weight: Optional[int] = None,
+ ):
+ self._dag_id: str = dag_id
+ self._task_id: str = task_id
+ self._run_id: str = run_id
+ self._start_date: datetime = start_date
+ self._end_date: datetime = end_date
+ self._try_number: int = try_number
+ self._state: str = state
+ self._executor_config: Any = executor_config
self._run_as_user: Optional[str] = None
- if hasattr(ti, 'run_as_user'):
- self._run_as_user = ti.run_as_user
- self._pool: str = ti.pool
+ self._run_as_user = run_as_user
Review comment:
Ah nice :)
--
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]