Skip to content

Commit

Permalink
Bump ruff to 0.3.3 (#38240)
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-awala authored Mar 18, 2024
1 parent 671ba75 commit 0a74928
Show file tree
Hide file tree
Showing 773 changed files with 904 additions and 306 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ repos:
types_or: [python, pyi]
args: [--fix]
require_serial: true
additional_dependencies: ["ruff==0.2.1"]
additional_dependencies: ["ruff==0.3.3"]
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py
- id: ruff-format
name: Run 'ruff format' for extremely fast Python formatting
Expand All @@ -348,7 +348,7 @@ repos:
types_or: [python, pyi]
args: []
require_serial: true
additional_dependencies: ["ruff==0.2.1"]
additional_dependencies: ["ruff==0.3.3"]
exclude: ^.*/.*_vendor/|^tests/dags/test_imports.py|^airflow/contrib/
- id: replace-bad-characters
name: Replace bad characters
Expand Down
1 change: 1 addition & 0 deletions airflow/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
# specific language governing permissions and limitations
# under the License.
"""Main executable module."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions airflow/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Authentication backend."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions airflow/api/auth/backend/basic_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
"""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions airflow/api/auth/backend/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Default authentication backend - everything is allowed."""

from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions airflow/api/auth/backend/deny_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Authentication backend that denies all requests."""

from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions airflow/api/auth/backend/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Session authentication backend."""

from __future__ import annotations

from functools import wraps
Expand Down
1 change: 1 addition & 0 deletions airflow/api/client/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""API Client that allows interacting with Airflow API."""

from __future__ import annotations

from importlib import import_module
Expand Down
1 change: 1 addition & 0 deletions airflow/api/client/api_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Client for all the API clients."""

from __future__ import annotations

import httpx
Expand Down
1 change: 1 addition & 0 deletions airflow/api/client/json_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""JSON API Client."""

from __future__ import annotations

from urllib.parse import urljoin
Expand Down
1 change: 1 addition & 0 deletions airflow/api/client/local_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Local client API."""

from __future__ import annotations

from airflow.api.client import api_client
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/delete_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Delete DAGs APIs."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Experimental APIs."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/delete_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use :mod:`airflow.api.common.delete_dag` instead."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/get_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Get code APIs."""

from __future__ import annotations

from deprecated import deprecated
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/get_dag_run_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""DAG run APIs."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/get_dag_runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""DAG runs APIs."""

from __future__ import annotations

from typing import Any
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/get_lineage.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Lineage APIs."""

from __future__ import annotations

from collections import defaultdict
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/get_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Task APIs."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/get_task_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Task instance APIs."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/mark_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Task Instance APIs. This module is deprecated. Please use :mod:`airflow.api.common.mark_tasks` instead."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Pool APIs."""

from __future__ import annotations

from typing import TYPE_CHECKING
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/experimental/trigger_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""This module is deprecated. Please use :mod:`airflow.api.common.trigger_dag` instead."""

from __future__ import annotations

import warnings
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/mark_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Marks tasks APIs."""

from __future__ import annotations

from typing import TYPE_CHECKING, Collection, Iterable, Iterator, NamedTuple
Expand Down
1 change: 1 addition & 0 deletions airflow/api/common/trigger_dag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Triggering DAG runs APIs."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions airflow/auth/managers/fab/api/auth/backend/basic_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.basic_auth` instead.
"""

from __future__ import annotations

import warnings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
Please use :mod:`airflow.providers.fab.auth_manager.api.auth.backend.kerberos_auth` instead.
"""

from __future__ import annotations

import warnings
Expand Down
6 changes: 2 additions & 4 deletions airflow/auth/managers/models/base_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ def is_active(self) -> bool:
return True

@abstractmethod
def get_id(self) -> str:
...
def get_id(self) -> str: ...

@abstractmethod
def get_name(self) -> str:
...
def get_name(self) -> str: ...
1 change: 1 addition & 0 deletions airflow/cli/commands/celery_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# DO NOT MODIFY THIS FILE unless it is a serious bugfix - all the new celery commands should be added in celery provider.
# This file is kept for backward compatibility only.
"""Celery command."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/config_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Config sub-commands."""

from __future__ import annotations

from io import StringIO
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/connection_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Connection sub-commands."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/dag_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Dag sub-commands."""

from __future__ import annotations

import ast
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/dag_processor_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""DagProcessor command."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/db_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Database sub-commands."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/info_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Config sub-commands."""

from __future__ import annotations

import locale
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/internal_api_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Internal API command."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/kerberos_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Kerberos command."""

from __future__ import annotations

from airflow import settings
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/kubernetes_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Kubernetes sub-commands."""

from __future__ import annotations

import os
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/pool_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Pools sub-commands."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/provider_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Providers sub-commands."""

from __future__ import annotations

import sys
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/rotate_fernet_key_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Rotate Fernet key command."""

from __future__ import annotations

from sqlalchemy import select
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/scheduler_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Scheduler command."""

from __future__ import annotations

import logging
Expand Down
4 changes: 2 additions & 2 deletions airflow/cli/commands/task_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Task sub-commands."""

from __future__ import annotations

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


class _SupportedDebugger(Protocol):
def post_mortem(self) -> None:
...
def post_mortem(self) -> None: ...


SUPPORTED_DEBUGGER_MODULES = [
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/triggerer_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Triggerer command."""

from __future__ import annotations

from contextlib import contextmanager
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/variable_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
# specific language governing permissions and limitations
# under the License.
"""Variable subcommands."""

from __future__ import annotations

import json
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/version_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Version command."""

from __future__ import annotations

import airflow
Expand Down
1 change: 1 addition & 0 deletions airflow/cli/commands/webserver_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
"""Webserver command."""

from __future__ import annotations

import logging
Expand Down
Loading

0 comments on commit 0a74928

Please sign in to comment.