Skip to content

Static typing: missing @overload to ensure return type is a str when default_value is set #4113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tonnico opened this issue Apr 11, 2024 · 3 comments · Fixed by #4114
Closed
Assignees
Labels
typing Static typing definition related issues (mypy, pyright, etc.)

Comments

@tonnico
Copy link
Contributor

tonnico commented Apr 11, 2024

Static type checker used

pyright/pylance

AWS Lambda function runtime

3.12

Powertools for AWS Lambda (Python) version

latest

Static type checker info

Expression of type "str | None" cannot be assigned to declared type "str"

Like in #3839 I found some more places for missing overloads.

Code snippet

header_value: str = event.get_header_value("name", "")

Possible Solution

No response

@rubenfonseca
Copy link
Contributor

Looking at this now

@rubenfonseca
Copy link
Contributor

Awesome, a lot to review here, but thank you already for opening this!

@rubenfonseca rubenfonseca removed the triage Pending triage from maintainers label Apr 12, 2024
@rubenfonseca rubenfonseca moved this from Triage to Working on it in Powertools for AWS Lambda (Python) Apr 12, 2024
@rubenfonseca rubenfonseca self-assigned this Apr 12, 2024
@github-project-automation github-project-automation bot moved this from Working on it to Coming soon in Powertools for AWS Lambda (Python) Apr 12, 2024
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

This issue is now closed. Please be mindful that future comments are hard for our team to see.

If you need more assistance, please either tag a team member or open a new issue that references this one.

If you wish to keep having a conversation with other community members under this issue feel free to do so.

@leandrodamascena leandrodamascena moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python) Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
typing Static typing definition related issues (mypy, pyright, etc.)
Projects
Status: Shipped
2 participants