tysoncung opened a new pull request, #67880: URL: https://github.com/apache/airflow/pull/67880
### Fixes #67653 The `state` parameter on `DagRun.get_task_instances` and `DagRun.fetch_task_instances` was annotated as `Iterable[TaskInstanceState | None] | None`, but the runtime handles a single `TaskInstanceState` value via an `isinstance(state, str)` short-circuit. Since `TaskInstanceState(str, Enum)` inherits from `str`, calling with `state=TaskInstanceState.FAILED` works at runtime but mypy/pyright flags it. **Fix:** Widen the annotation to `TaskInstanceState | Iterable[TaskInstanceState | None] | None` on both methods to match the actual runtime behaviour. -- 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]
