Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions airflow-core/src/airflow/operators/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from airflow.utils.deprecation_tools import add_deprecated_classes

__deprecated_classes = {
"python":{
"python": {
"PythonOperator": "airflow.providers.standard.operators.python.PythonOperator",
"BranchPythonOperator": "airflow.providers.standard.operators.python.BranchPythonOperator",
"ShortCircuitOperator": "airflow.providers.standard.operators.python.ShortCircuitOperator",
Expand All @@ -37,10 +37,10 @@
"BranchPythonVirtualenvOperator": "airflow.providers.standard.operators.python.BranchPythonVirtualenvOperator",
"get_current_context": "airflow.sdk.get_current_context",
},
"bash":{
"bash": {
"BashOperator": "airflow.providers.standard.operators.bash.BashOperator",
},
"datetime":{
"datetime": {
"BranchDateTimeOperator": "airflow.providers.standard.operators.datetime.BranchDateTimeOperator",
},
"generic_transfer": {
Expand All @@ -64,7 +64,7 @@
"smooth": {
"SmoothOperator": "airflow.providers.standard.operators.smooth.SmoothOperator",
},
"branch":{
"branch": {
"BranchMixIn": "airflow.providers.standard.operators.branch.BranchMixIn",
"BaseBranchOperator": "airflow.providers.standard.operators.branch.BaseBranchOperator",
}
Expand Down
1 change: 0 additions & 1 deletion airflow-core/src/airflow/plugins_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

from __future__ import annotations

import importlib
import importlib.machinery
import importlib.util
import inspect
Expand Down
6 changes: 3 additions & 3 deletions airflow-core/src/airflow/sensors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"PokeReturnValue": "airflow.sdk.bases.sensor.PokeReturnValue",
"poke_mode_only": "airflow.sdk.bases.sensor.poke_mode_only",
},
"python":{
"python": {
"PythonSensor": "airflow.providers.standard.sensors.python.PythonSensor",
},
"bash":{
"bash": {
"BashSensor": "airflow.providers.standard.sensors.bash.BashSensor",
},
"date_time":{
"date_time": {
"DateTimeSensor": "airflow.providers.standard.sensors.date_time.DateTimeSensor",
"DateTimeSensorAsync": "airflow.providers.standard.sensors.date_time.DateTimeSensorAsync",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from airflow.models.taskinstance import PAST_DEPENDS_MET
from airflow.ti_deps.deps.base_ti_dep import BaseTIDep

## The following constants are taken from the SkipMixin class in the standard provider
# The following constants are taken from the SkipMixin class in the standard provider
# The key used by SkipMixin to store XCom data.
XCOM_SKIPMIXIN_KEY = "skipmixin_key"

Expand Down
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/utils/log/file_task_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def _fetch_logs_from_service(url: str, log_relative_path: str) -> Response:
algorithm="HS512",
# We must set an empty private key here as otherwise it can be automatically loaded by JWTGenerator
# and secret_key and private_key cannot be set together
private_key=None, # type: ignore[arg-type]
private_key=None, # type: ignore[arg-type]
issuer=None,
valid_for=conf.getint("webserver", "log_request_clock_grace", fallback=30),
audience="task-instance-logs",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,9 @@ def test_update_mask_preserves_other_fields(self, test_client, session):

# Assert: fetch from DB and check only masked field changed
updated_pool = session.query(Pool).filter_by(pool="pool1").one()
assert updated_pool.slots == 50 # updated
assert updated_pool.description is None # unchanged
assert updated_pool.include_deferred is True # unchanged
assert updated_pool.slots == 50 # updated
assert updated_pool.description is None # unchanged
assert updated_pool.include_deferred is True # unchanged

def test_should_respond_401(self, unauthenticated_test_client):
response = unauthenticated_test_client.patch("/pools", json={})
Expand Down
1 change: 0 additions & 1 deletion airflow-core/tests/unit/utils/test_log_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import io
import itertools
import logging
import logging.config
import os
import re
from http import HTTPStatus
Expand Down
2 changes: 0 additions & 2 deletions dev/airflow-github
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,7 @@ def cli():
" searching for few commits to find the cherry-picked commits",
)
@click.option("--unmerged", "show_uncherrypicked_only", help="Show unmerged PRs only", is_flag=True)

@click.option("--show-commits", help="Show commit SHAs (default: on, off when --unmerged)", is_flag=True, default=None)

def compare(target_version, github_token, previous_version=None, show_uncherrypicked_only=False, show_commits=None):
# Set smart defaults
if show_commits is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# under the License.
from __future__ import annotations

import concurrent
import concurrent.futures
import datetime
import itertools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from pathlib import Path
from typing import TYPE_CHECKING, Any

import botocore.client
import botocore.exceptions
import botocore.waiter

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from __future__ import annotations

import logging
import logging.config
from importlib import reload
from unittest import mock

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from __future__ import annotations

import logging
import logging.config
import re
from importlib import reload
from unittest import mock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class DbApiHook(BaseHook):
) -> PandasDataFrame: ...
def get_pandas_df_by_chunks(
self, sql, parameters: list | tuple | Mapping[str, Any] | None = None, *, chunksize: int, **kwargs
) -> Generator[PandasDataFrame, None, None]: ...
) -> Generator[PandasDataFrame]: ...
def get_records(
self, sql: str | list[str], parameters: Iterable | Mapping[str, Any] | None = None
) -> Any: ...
Expand Down Expand Up @@ -143,7 +143,7 @@ class DbApiHook(BaseHook):
chunksize: int,
df_type: Literal["pandas"] = "pandas",
**kwargs,
) -> Generator[PandasDataFrame, None, None]: ...
) -> Generator[PandasDataFrame]: ...
@overload
def get_df_by_chunks(
self,
Expand All @@ -153,7 +153,7 @@ class DbApiHook(BaseHook):
chunksize: int,
df_type: Literal["polars"],
**kwargs,
) -> Generator[PolarsDataFrame, None, None]: ...
) -> Generator[PolarsDataFrame]: ...
@staticmethod
def strip_sql_string(sql: str) -> str: ...
@staticmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import json
import logging
import logging.config
from unittest import mock

import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import inspect
import logging
import logging.config
from unittest.mock import MagicMock

import pandas as pd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
from unittest.mock import AsyncMock

import aiohttp
import aiohttp.client_exceptions
import azure.identity
import azure.identity.aio
import pytest
import tenacity
from azure.core.credentials import AccessToken
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def set_state(
free_concurrency=int(body.sysinfo["free_concurrency"]),
queues=worker.queues,
)
_assert_version(body.sysinfo) # Exception only after worker state is in the DB
_assert_version(body.sysinfo) # Exception only after worker state is in the DB
return WorkerSetStateReturn(
state=worker.state, queues=worker.queues, maintenance_comments=worker.maintenance_comment
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ def get_datasets_list(
if return_iterator:
# The iterator returned by list_datasets() is a HTTPIterator but annotated
# as Iterator
return iterator # type: ignore
return iterator # type: ignore

datasets_list = list(iterator)
self.log.info("Datasets List: %s", len(datasets_list))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ async def get_job_status(
job = await self.get_job(
project_id=project_id,
job_id=job_id,
session=session, # type: ignore
session=session, # type: ignore
)
job = await job.json(content_type=None)
self.log.info("Retrieving json_response: %s", job)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from functools import wraps
from typing import TypeVar, cast

import google
import google.auth.transport.requests
import google.oauth2.id_token

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from typing import TYPE_CHECKING, Any, TypeVar, cast

import google.auth
import google.oauth2.service_account
import google_auth_httplib2
import requests
import tenacity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
import os
from typing import TYPE_CHECKING

import google.auth.transport
from google.auth import credentials as google_auth_credentials, environment_vars, exceptions
from google.oauth2 import credentials as oauth2_credentials, service_account

if TYPE_CHECKING:
import google.oauth2
import google.auth.transport

# Valid types accepted for file-based credentials.
# They are taken from "google.auth._default" and since they are all "protected" and the imports might
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from typing import TYPE_CHECKING, Any, Literal, Protocol, TypeAlias, cast, overload

import psycopg2
import psycopg2.extensions
import psycopg2.extras
from more_itertools import chunked
from psycopg2.extras import DictCursor, NamedTupleCursor, RealDictCursor, execute_batch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import copy
import logging
import logging.config
import os
import pickle
import re
Expand Down
1 change: 0 additions & 1 deletion scripts/ci/prek/significant_newsfragments_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
import re

import docutils.nodes
import docutils.parsers.rst
from docutils.core import publish_doctree
from jinja2 import BaseLoader, Environment

Expand Down
4 changes: 2 additions & 2 deletions task-sdk/src/airflow/sdk/definitions/asset/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def _validate_identifier(instance, attribute, value):
raise ValueError(f"{type(instance).__name__} {attribute.name} cannot exceed 1500 characters")
if value.isspace():
raise ValueError(f"{type(instance).__name__} {attribute.name} cannot be just whitespace")
## We use latin1_general_cs to store the name (and group, asset values etc.) on MySQL.
## relaxing this check for non mysql backend
# We use latin1_general_cs to store the name (and group, asset values etc.) on MySQL.
# relaxing this check for non mysql backend
if SQL_ALCHEMY_CONN.startswith("mysql") and not value.isascii():
raise ValueError(f"{type(instance).__name__} {attribute.name} must only consist of ASCII characters")
return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
from airflow.sdk.definitions.context import Context

BoolConditionFunc: TypeAlias = Callable[[Context], bool]
MsgConditionFunc: TypeAlias = "Callable[[Context], tuple[bool, str | None]]"
AnyConditionFunc: TypeAlias = "BoolConditionFunc | MsgConditionFunc"
MsgConditionFunc: TypeAlias = Callable[[Context], tuple[bool, str | None]]
AnyConditionFunc: TypeAlias = BoolConditionFunc | MsgConditionFunc

__all__ = ["run_if", "skip_if"]

Expand Down
6 changes: 3 additions & 3 deletions task-sdk/tests/task_sdk/execution_time/test_supervisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1208,7 +1208,7 @@ def _handler(sig, frame):

def test_service_subprocess(self, watched_subprocess, mock_process, mocker):
"""Test `_service_subprocess` processes selector events and handles subprocess exit."""
## Given
# Given

# Mock file objects and handlers
mock_stdout = mocker.Mock()
Expand All @@ -1228,10 +1228,10 @@ def test_service_subprocess(self, watched_subprocess, mock_process, mocker):
# Mock to simulate process exited successfully
mock_process.wait.return_value = 0

## Our actual test
# Our actual test
watched_subprocess._service_subprocess(max_wait_time=1.0)

## Validations!
# Validations!
# Validate selector interactions
watched_subprocess.selector.select.assert_called_once_with(timeout=1.0)

Expand Down
Loading