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
4 changes: 2 additions & 2 deletions airflow-core/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ dependencies = [
"argcomplete>=1.10",
"asgiref>=2.3.0",
"attrs>=22.1.0, !=25.2.0",
"cadwyn>=5.2.1",
"cadwyn>=5.6.1",
"colorlog>=6.8.2",
"cron-descriptor>=1.2.24",
"croniter>=2.0.2",
# TODO(potiuk): We should bump cryptography to >=46.0.0 when sqlalchemy>=2.0 is required
"cryptography>=41.0.0,<46.0.0",
"deprecated>=1.2.13",
"dill>=0.2.2",
"fastapi[standard-no-fastapi-cloud-cli]>=0.116.0,<0.118.0",
"fastapi[standard-no-fastapi-cloud-cli]>=0.121.0",
"uvicorn>=0.37.0",
"starlette>=0.45.0",
"httpx>=0.25.0",
Expand Down
2 changes: 1 addition & 1 deletion airflow-core/src/airflow/api_fastapi/common/db/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _get_session() -> Generator[Session, None, None]:
yield session


SessionDep = Annotated[Session, Depends(_get_session)]
SessionDep = Annotated[Session, Depends(_get_session, scope="function")]


def apply_filters_to_select(
Expand Down
3 changes: 3 additions & 0 deletions airflow-core/src/airflow/api_fastapi/logging/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,8 @@ async def log_action(
else:
logger.warning("Logical date is missing or empty")
session.add(log)
# Explicit commit to persist the access log independently if the path operation fails or not.
# Also it cannot be deferred to a 'function' scoped dependency because of the `request` parameter.
session.commit()

return log_action
7 changes: 7 additions & 0 deletions chart/newsfragments/58524.significant.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FastAPI dependency is updated and lower bound set to ``0.121.0``

Airflow now requires FastAPI ``>=0.121.0`` and removes the previous upper
constraint. This aligns with FastAPI's new dependency lifecycle scopes
(e.g. request/function) that change how dependencies with ``yield`` are
exited.
See `FastAPI PR #14262 <https://github.com/fastapi/fastapi/pull/14262>`_.
2 changes: 2 additions & 0 deletions task-sdk/dev/generate_task_sdk_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import os
import sys
from pathlib import Path
from unittest import mock

import httpx
from datamodel_code_generator import (
Expand Down Expand Up @@ -75,6 +76,7 @@ def load_config():
return cfg


@mock.patch("fastapi._compat.v2.get_long_model_name", lambda model: model.__name__)
def generate_file():
from airflow.api_fastapi.execution_api.app import InProcessExecutionAPI

Expand Down
Loading