diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6070320ed1ac0..9bb4e012581b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -221,7 +221,7 @@ repos: hooks: - id: isort name: Run isort to sort imports in Python files - files: \.py$ + files: \.py|\.pyi$ # To keep consistent with the global isort skip config defined in setup.cfg exclude: ^build/.*$|^.tox/.*$|^venv/.*$|^airflow/_vendor/ - repo: https://github.com/pycqa/pydocstyle diff --git a/airflow/providers/alibaba/cloud/operators/oss.pyi b/airflow/providers/alibaba/cloud/operators/oss.pyi index a0ea439d29b7b..50f003b83e44b 100644 --- a/airflow/providers/alibaba/cloud/operators/oss.pyi +++ b/airflow/providers/alibaba/cloud/operators/oss.pyi @@ -19,6 +19,7 @@ # validating how required arguments can be passed to operators/sensors via `default_args`. from typing import Optional + from airflow.models import BaseOperator class OSSCreateBucketOperator(BaseOperator): diff --git a/airflow/providers/microsoft/azure/operators/wasb_delete_blob.pyi b/airflow/providers/microsoft/azure/operators/wasb_delete_blob.pyi index 1896986b6280c..773d57deef793 100644 --- a/airflow/providers/microsoft/azure/operators/wasb_delete_blob.pyi +++ b/airflow/providers/microsoft/azure/operators/wasb_delete_blob.pyi @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. # -from typing import Optional, Any +from typing import Any, Optional from airflow.models import BaseOperator diff --git a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.pyi b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.pyi index 4e1551d5146d8..196786cc96f34 100644 --- a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.pyi +++ b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.pyi @@ -16,7 +16,7 @@ # specific language governing permissions and limitations # under the License. # -from typing import Optional, Union, Sequence +from typing import Optional, Sequence, Union from airflow.models import BaseOperator diff --git a/airflow/utils/context.pyi b/airflow/utils/context.pyi index e950888450cae..4df57b20df67e 100644 --- a/airflow/utils/context.pyi +++ b/airflow/utils/context.pyi @@ -25,7 +25,7 @@ # undefined attribute errors from Mypy. Hopefully there will be a mechanism to # declare "these are defined, but don't error if others are accessed" someday. -from typing import Any, Container, Mapping, Optional, Union, Mapping +from typing import Any, Container, Mapping, Optional, Union from pendulum import DateTime