Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
53b7e87
fix(event-handler): replace Optional[X] and List[X] with X | None and…
hirenkumar-n-dholariya May 7, 2026
213eb33
fix(event-handler): replace Optional[X] and Dict[X] with modern synta…
hirenkumar-n-dholariya May 7, 2026
c0fb486
fix(event-handler): replace Optional[list] with list | None in graphq…
hirenkumar-n-dholariya May 7, 2026
2503665
fix(event-handler): fix ruff lint violations in util.py docstrings
hirenkumar-n-dholariya May 7, 2026
0e464e6
fix(event-handler): fix ruff lint violations in appsync.py docstrings
hirenkumar-n-dholariya May 7, 2026
d785236
fix(event-handler): fix ruff lint violations in graphql_appsync/_regi…
hirenkumar-n-dholariya May 7, 2026
949d565
fix(event-handler): fix ruff lint violations in middlewares/openapi_v…
hirenkumar-n-dholariya May 7, 2026
adbbc5a
fix(event-handler): restore removed comment in OpenAPIExtensions class
hirenkumar-n-dholariya May 8, 2026
1a4945d
fix(event-handler): restore accidentally removed comments in openapi/…
hirenkumar-n-dholariya May 8, 2026
67d5309
fix(event-handler): restore accidentally removed comments in openapi/…
hirenkumar-n-dholariya May 8, 2026
1aae45f
fix(event-handler): add missing from __future__ import annotations in…
hirenkumar-n-dholariya May 8, 2026
2c2be2f
fix(event-handler): revert validator signature to Optional in oauth2.py
hirenkumar-n-dholariya May 8, 2026
82601a0
fix(event-handler): fix UP045 lint error in oauth2.py validator signa…
hirenkumar-n-dholariya May 8, 2026
a456547
Merge branch 'develop' into fix/ruff-lint-event-handler-8088
hirenkumar-n-dholariya May 29, 2026
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 aws_lambda_powertools/event_handler/appsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ def resolver(self, type_name: str = "*", field_name: str | None = None) -> Calla
----------
type_name : str, optional
GraphQL type e.g., Query, Mutation, by default "*" meaning any
field_name : Optional[str], optional
field_name : str | None, optional
GraphQL field e.g., getTodo, createTodo, by default None

Returns
Expand Down Expand Up @@ -447,7 +447,7 @@ def batch_resolver(
----------
type_name : str, optional
GraphQL type e.g., Query, Mutation, by default "*" meaning any
field_name : Optional[str], optional
field_name : str | None, optional
GraphQL field e.g., getTodo, createTodo, by default None
raise_on_error : bool, optional
Whether to fail entire batch upon error, or handle errors gracefully (None), by default False
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def find_resolver(self, type_name: str, field_name: str) -> dict | None:
Field name
Return
----------
Optional[Dict]
dict | None
A dictionary with the resolver and if raise exception on error
"""
logger.debug(f"Looking for resolver for type={type_name}, field={field_name}.")
Expand Down
12 changes: 3 additions & 9 deletions aws_lambda_powertools/event_handler/graphql_appsync/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,14 @@ def resolver(self, type_name: str = "*", field_name: str | None = None) -> Calla
Examples
--------
```python
from typing import Optional

from aws_lambda_powertools.event_handler import AppSyncResolver
from aws_lambda_powertools.utilities.data_classes import AppSyncResolverEvent
from aws_lambda_powertools.utilities.typing import LambdaContext

app = AppSyncResolver()

@app.resolver(type_name="Query", field_name="getPost")
def related_posts(event: AppSyncResolverEvent) -> Optional[list]:
def related_posts(event: AppSyncResolverEvent) -> list | None:
return {"success": "ok"}

def lambda_handler(event, context: LambdaContext) -> dict:
Expand Down Expand Up @@ -76,16 +74,14 @@ def batch_resolver(
Examples
--------
```python
from typing import Optional

from aws_lambda_powertools.event_handler import AppSyncResolver
from aws_lambda_powertools.utilities.data_classes import AppSyncResolverEvent
from aws_lambda_powertools.utilities.typing import LambdaContext

app = AppSyncResolver()

@app.batch_resolver(type_name="Query", field_name="getPost")
def related_posts(event: AppSyncResolverEvent, id) -> Optional[list]:
def related_posts(event: AppSyncResolverEvent, id) -> list | None:
return {"post_id": id}

def lambda_handler(event, context: LambdaContext) -> dict:
Expand Down Expand Up @@ -127,16 +123,14 @@ def async_batch_resolver(
Examples
--------
```python
from typing import Optional

from aws_lambda_powertools.event_handler import AppSyncResolver
from aws_lambda_powertools.utilities.data_classes import AppSyncResolverEvent
from aws_lambda_powertools.utilities.typing import LambdaContext

app = AppSyncResolver()

@app.async_batch_resolver(type_name="Query", field_name="getPost")
async def related_posts(event: AppSyncResolverEvent, id) -> Optional[list]:
async def related_posts(event: AppSyncResolverEvent, id) -> list | None:
return {"post_id": id}

def lambda_handler(event, context: LambdaContext) -> dict:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,11 +505,11 @@ def _is_or_contains_sequence(annotation: Any) -> bool:

This function handles complex type annotations like:
- List[Model] - direct sequence
- Union[Model, List[Model]] - checks if any Union member is a sequence
- Optional[List[Model]] - Union[List[Model], None]
- RootModel[List[Model]] - checks if the RootModel wraps a sequence
- Optional[RootModel[List[Model]]] - Union member that is a RootModel
- RootModel[Union[Model, List[Model]]] - RootModel wrapping a Union with a sequence
- Union[Model, list[Model]] - checks if any Union member is a sequence
- list[Model] | None - Union[list[Model], None]
- RootModel[list[Model]] - checks if the RootModel wraps a sequence
- RootModel[list[Model]] | None - Union member that is a RootModel
- RootModel[Union[Model, list[Model]]] - RootModel wrapping a Union with a sequence
"""
# Direct sequence check
if field_annotation_is_sequence(annotation):
Expand Down
Loading