kaxil commented on code in PR #52234:
URL: https://github.com/apache/airflow/pull/52234#discussion_r2190960709
##########
airflow-core/src/airflow/models/taskinstance.py:
##########
@@ -1898,22 +1897,23 @@ def get_template_context(
:param session: SQLAlchemy ORM Session
:param ignore_param_exceptions: flag to suppress value exceptions
while initializing the ParamsDict
"""
- if TYPE_CHECKING:
- assert self.task
- assert isinstance(self.task.dag, SchedulerDAG)
-
# Do not use provide_session here -- it expunges everything on exit!
if not session:
session = settings.Session()
+ if TYPE_CHECKING:
+ assert session
+ assert isinstance(self.task, (BaseOperator, MappedOperator))
Review Comment:
We can use `Operator` here I think since it is already defined at L136:
```
Operator: TypeAlias = BaseOperator | MappedOperator
```
--
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]