You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ta...@apache.org on 2023/10/18 12:46:39 UTC
[airflow] branch main updated: Change type annotation for `BaseOperatorLink.operators` (#35003)
This is an automated email from the ASF dual-hosted git repository.
taragolis pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new bf23932c59 Change type annotation for `BaseOperatorLink.operators` (#35003)
bf23932c59 is described below
commit bf23932c598225e38359892103df4a319179c529
Author: Andrey Anshin <An...@taragol.is>
AuthorDate: Wed Oct 18 16:46:31 2023 +0400
Change type annotation for `BaseOperatorLink.operators` (#35003)
---
airflow/models/baseoperator.py | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/airflow/models/baseoperator.py b/airflow/models/baseoperator.py
index 5993551f93..4e4a1c9bea 100644
--- a/airflow/models/baseoperator.py
+++ b/airflow/models/baseoperator.py
@@ -37,9 +37,7 @@ from typing import (
ClassVar,
Collection,
Iterable,
- List,
Sequence,
- Type,
TypeVar,
Union,
cast,
@@ -1891,19 +1889,11 @@ def chain_linear(*elements: DependencyMixin | Sequence[DependencyMixin]):
raise ValueError("No dependencies were set. Did you forget to expand with `*`?")
-# pyupgrade assumes all type annotations can be lazily evaluated, but this is
-# not the case for attrs-decorated classes, since cattrs needs to evaluate the
-# annotation expressions at runtime, and Python before 3.9.0 does not lazily
-# evaluate those. Putting the expression in a top-level assignment statement
-# communicates this runtime requirement to pyupgrade.
-BaseOperatorClassList = List[Type[BaseOperator]]
-
-
@attr.s(auto_attribs=True)
class BaseOperatorLink(metaclass=ABCMeta):
"""Abstract base class that defines how we get an operator link."""
- operators: ClassVar[BaseOperatorClassList] = []
+ operators: ClassVar[list[type[BaseOperator]]] = []
"""
This property will be used by Airflow Plugins to find the Operators to which you want
to assign this Operator Link