fix(event-handler): fix ruff lint violations in event_handler module#8208
Open
hirenkumar-n-dholariya wants to merge 7 commits intoaws-powertools:developfrom
Open
Conversation
… list[X] in openapi/models.py Replace deprecated typing aliases with modern Python 3.10+ syntax: - Optional[X] -> X | None - List[X] -> list[X] - Dict[X, Y] -> dict[X, Y] - Set[X] -> set[X] - Remove unused imports: Dict, List, Optional, Set from typing Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
…x in swagger_ui/oauth2.py - Optional[str] -> str | None - Dict[str, str] -> dict[str, str] - Remove unused imports: Dict, Optional from typing Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
…l_appsync/base.py docstrings Update docstring code examples to use modern Python 3.10+ syntax: - Optional[list] -> list | None - Remove unused `from typing import Optional` from examples Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
Update docstring parameter type hints to use modern Python 3.10+ syntax: - List[Dict[str, List[str]]] -> list[dict[str, list[str]]] - Optional[Dict[str, Any]] -> dict[str, Any] | None Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
Update docstring parameter type hints to use modern Python 3.10+ syntax: - Optional[str] -> str | None in field_name parameter descriptions Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
…stry.py docstrings Update docstring return type hints to use modern Python 3.10+ syntax: - Optional[Dict] -> dict | None in Returns section Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
…alidation.py comments Update inline comments to use modern Python 3.10+ syntax: - List[Model] -> list[Model] - Optional[List[Model]] -> list[Model] | None - Optional[RootModel[List[Model]]] -> RootModel[list[Model]] | None Part of aws-powertools#8088 Signed-off-by: hirenkumar-n-dholariya <hirenkumarnd@gmail.com>
|
No acknowledgement section found. Please make sure you used the template to open a PR and didn't remove the acknowledgment section. Check the template at |
|
2 tasks
|
Can you please add the acknowledgement section to the PR? |
svozza
reviewed
May 8, 2026
| openapi_extensions: Optional[Dict[str, Any]] = None | ||
| openapi_extensions: dict[str, Any] | None = None | ||
|
|
||
| # If the 'openapi_extensions' field is present in the 'values' dictionary, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Issue number: fixes #8088
Summary
Fix ruff lint violations in
aws_lambda_powertools/event_handler/after the ruff target bump.Changes
Optional[X]withX | NoneList[X]withlist[X]Dict[X, Y]withdict[X, Y]Set[X]withset[X]typingmoduleFiles changed
event_handler/openapi/models.py- largest file, 90+ replacements in field annotationsevent_handler/openapi/swagger_ui/oauth2.py- 3 field annotations + validator signatureevent_handler/graphql_appsync/base.py- 3 docstring code examples updatedevent_handler/appsync.py- docstring parameter type hints updatedevent_handler/graphql_appsync/_registry.py- docstring return type updatedevent_handler/util.py- docstring parameter type hints updatedUser experience
Before: ruff lint violations after target version bump causing CI failures
*