Skip to content

Commit

Permalink
Merge branch 'main' into fix/also-suppress-jexception-in-jdbc-hook-wh…
Browse files Browse the repository at this point in the history
…en-unsupported
  • Loading branch information
dabla authored Nov 19, 2024
2 parents d77c569 + a60d105 commit c6fe6df
Show file tree
Hide file tree
Showing 65 changed files with 1,432 additions and 1,030 deletions.
3 changes: 3 additions & 0 deletions airflow/api_connexion/endpoints/asset_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def _generate_queued_event_where_clause(
return where_clause


@mark_fastapi_migration_done
@security.requires_access_asset("GET")
@security.requires_access_dag("GET")
@provide_session
Expand All @@ -203,6 +204,7 @@ def get_dag_asset_queued_event(
return queued_event_schema.dump(queued_event)


@mark_fastapi_migration_done
@security.requires_access_asset("DELETE")
@security.requires_access_dag("GET")
@provide_session
Expand Down Expand Up @@ -303,6 +305,7 @@ def get_asset_queued_events(
)


@mark_fastapi_migration_done
@security.requires_access_asset("DELETE")
@action_logging
@provide_session
Expand Down
2 changes: 1 addition & 1 deletion airflow/api_connexion/endpoints/xcom_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def get_xcom_entry(
stub.value = XCom.deserialize_value(stub)
item = stub

if stringify or conf.getboolean("core", "enable_xcom_pickling"):
if stringify:
return xcom_schema_string.dump(item)

return xcom_schema_native.dump(item)
10 changes: 5 additions & 5 deletions airflow/api_fastapi/common/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from fastapi import Depends, HTTPException, Query
from pendulum.parsing.exceptions import ParserError
from pydantic import AfterValidator, BaseModel
from pydantic import AfterValidator, BaseModel, NonNegativeInt
from sqlalchemy import Column, case, or_
from sqlalchemy.inspection import inspect

Expand Down Expand Up @@ -66,7 +66,7 @@ def depends(self, *args: Any, **kwargs: Any) -> Self:
pass


class LimitFilter(BaseParam[int]):
class LimitFilter(BaseParam[NonNegativeInt]):
"""Filter on the limit."""

def to_orm(self, select: Select) -> Select:
Expand All @@ -75,19 +75,19 @@ def to_orm(self, select: Select) -> Select:

return select.limit(self.value)

def depends(self, limit: int = 100) -> LimitFilter:
def depends(self, limit: NonNegativeInt = 100) -> LimitFilter:
return self.set_value(limit)


class OffsetFilter(BaseParam[int]):
class OffsetFilter(BaseParam[NonNegativeInt]):
"""Filter on offset."""

def to_orm(self, select: Select) -> Select:
if self.value is None and self.skip_none:
return select
return select.offset(self.value)

def depends(self, offset: int = 0) -> OffsetFilter:
def depends(self, offset: NonNegativeInt = 0) -> OffsetFilter:
return self.set_value(offset)


Expand Down
Loading

0 comments on commit c6fe6df

Please sign in to comment.