Skip to content

Commit 0a74928

Browse files
Bump ruff to 0.3.3 (#38240)
1 parent 671ba75 commit 0a74928

File tree

773 files changed

+904
-306
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

773 files changed

+904
-306
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ repos:
338338
types_or: [python, pyi]
339339
args: [--fix]
340340
require_serial: true
341-
additional_dependencies: ["ruff==0.2.1"]
341+
additional_dependencies: ["ruff==0.3.3"]
342342
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py
343343
- id: ruff-format
344344
name: Run 'ruff format' for extremely fast Python formatting
@@ -348,7 +348,7 @@ repos:
348348
types_or: [python, pyi]
349349
args: []
350350
require_serial: true
351-
additional_dependencies: ["ruff==0.2.1"]
351+
additional_dependencies: ["ruff==0.3.3"]
352352
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py|^airflow/contrib/
353353
- id: replace-bad-characters
354354
name: Replace bad characters

airflow/__main__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# specific language governing permissions and limitations
1919
# under the License.
2020
"""Main executable module."""
21+
2122
from __future__ import annotations
2223

2324
import os

airflow/api/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Authentication backend."""
19+
1920
from __future__ import annotations
2021

2122
import logging

airflow/api/auth/backend/basic_auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
2020
Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
2121
"""
22+
2223
from __future__ import annotations
2324

2425
import warnings

airflow/api/auth/backend/default.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Default authentication backend - everything is allowed."""
19+
1920
from __future__ import annotations
2021

2122
from functools import wraps

airflow/api/auth/backend/deny_all.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Authentication backend that denies all requests."""
19+
1920
from __future__ import annotations
2021

2122
from functools import wraps

airflow/api/auth/backend/session.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Session authentication backend."""
18+
1819
from __future__ import annotations
1920

2021
from functools import wraps

airflow/api/client/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""API Client that allows interacting with Airflow API."""
19+
1920
from __future__ import annotations
2021

2122
from importlib import import_module

airflow/api/client/api_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Client for all the API clients."""
19+
1920
from __future__ import annotations
2021

2122
import httpx

airflow/api/client/json_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""JSON API Client."""
19+
1920
from __future__ import annotations
2021

2122
from urllib.parse import urljoin

airflow/api/client/local_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Local client API."""
19+
1920
from __future__ import annotations
2021

2122
from airflow.api.client import api_client

airflow/api/common/delete_dag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Delete DAGs APIs."""
19+
1920
from __future__ import annotations
2021

2122
import logging

airflow/api/common/experimental/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Experimental APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import TYPE_CHECKING

airflow/api/common/experimental/delete_dag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""This module is deprecated. Please use :mod:`airflow.api.common.delete_dag` instead."""
19+
1920
from __future__ import annotations
2021

2122
import warnings

airflow/api/common/experimental/get_code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Get code APIs."""
19+
1920
from __future__ import annotations
2021

2122
from deprecated import deprecated

airflow/api/common/experimental/get_dag_run_state.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""DAG run APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import TYPE_CHECKING

airflow/api/common/experimental/get_dag_runs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""DAG runs APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import Any

airflow/api/common/experimental/get_lineage.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Lineage APIs."""
19+
1920
from __future__ import annotations
2021

2122
from collections import defaultdict

airflow/api/common/experimental/get_task.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Task APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import TYPE_CHECKING

airflow/api/common/experimental/get_task_instance.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Task instance APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import TYPE_CHECKING

airflow/api/common/experimental/mark_tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Task Instance APIs. This module is deprecated. Please use :mod:`airflow.api.common.mark_tasks` instead."""
19+
1920
from __future__ import annotations
2021

2122
import warnings

airflow/api/common/experimental/pool.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Pool APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import TYPE_CHECKING

airflow/api/common/experimental/trigger_dag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""This module is deprecated. Please use :mod:`airflow.api.common.trigger_dag` instead."""
19+
1920
from __future__ import annotations
2021

2122
import warnings

airflow/api/common/mark_tasks.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Marks tasks APIs."""
19+
1920
from __future__ import annotations
2021

2122
from typing import TYPE_CHECKING, Collection, Iterable, Iterator, NamedTuple

airflow/api/common/trigger_dag.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Triggering DAG runs APIs."""
19+
1920
from __future__ import annotations
2021

2122
import json

airflow/auth/managers/fab/api/auth/backend/basic_auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
2020
Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
2121
"""
22+
2223
from __future__ import annotations
2324

2425
import warnings

airflow/auth/managers/fab/api/auth/backend/kerberos_auth.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
2121
Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
2222
"""
23+
2324
from __future__ import annotations
2425

2526
import warnings

airflow/auth/managers/models/base_user.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ def is_active(self) -> bool:
2828
return True
2929

3030
@abstractmethod
31-
def get_id(self) -> str:
32-
...
31+
def get_id(self) -> str: ...
3332

3433
@abstractmethod
35-
def get_name(self) -> str:
36-
...
34+
def get_name(self) -> str: ...

airflow/cli/commands/celery_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# DO NOT MODIFY THIS FILE unless it is a serious bugfix - all the new celery commands should be added in celery provider.
2121
# This file is kept for backward compatibility only.
2222
"""Celery command."""
23+
2324
from __future__ import annotations
2425

2526
import logging

airflow/cli/commands/config_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Config sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
from io import StringIO

airflow/cli/commands/connection_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Connection sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
import json

airflow/cli/commands/dag_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Dag sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
import ast

airflow/cli/commands/dag_processor_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""DagProcessor command."""
18+
1819
from __future__ import annotations
1920

2021
import logging

airflow/cli/commands/db_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Database sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
import logging

airflow/cli/commands/info_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Config sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
import locale

airflow/cli/commands/internal_api_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Internal API command."""
18+
1819
from __future__ import annotations
1920

2021
import logging

airflow/cli/commands/kerberos_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Kerberos command."""
18+
1819
from __future__ import annotations
1920

2021
from airflow import settings

airflow/cli/commands/kubernetes_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Kubernetes sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
import os

airflow/cli/commands/pool_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Pools sub-commands."""
19+
1920
from __future__ import annotations
2021

2122
import json

airflow/cli/commands/provider_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Providers sub-commands."""
18+
1819
from __future__ import annotations
1920

2021
import sys

airflow/cli/commands/rotate_fernet_key_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Rotate Fernet key command."""
18+
1819
from __future__ import annotations
1920

2021
from sqlalchemy import select

airflow/cli/commands/scheduler_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Scheduler command."""
18+
1819
from __future__ import annotations
1920

2021
import logging

airflow/cli/commands/task_command.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Task sub-commands."""
19+
1920
from __future__ import annotations
2021

2122
import functools
@@ -513,8 +514,7 @@ def task_list(args, dag: DAG | None = None) -> None:
513514

514515

515516
class _SupportedDebugger(Protocol):
516-
def post_mortem(self) -> None:
517-
...
517+
def post_mortem(self) -> None: ...
518518

519519

520520
SUPPORTED_DEBUGGER_MODULES = [

airflow/cli/commands/triggerer_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Triggerer command."""
18+
1819
from __future__ import annotations
1920

2021
from contextlib import contextmanager

airflow/cli/commands/variable_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# specific language governing permissions and limitations
1717
# under the License.
1818
"""Variable subcommands."""
19+
1920
from __future__ import annotations
2021

2122
import json

airflow/cli/commands/version_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Version command."""
18+
1819
from __future__ import annotations
1920

2021
import airflow

airflow/cli/commands/webserver_command.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
"""Webserver command."""
18+
1819
from __future__ import annotations
1920

2021
import logging

0 commit comments

Comments
 (0)