Skip to content

Static typing: Getting type errors on logger append_keys usage #3989

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
leandrodamascena opened this issue Mar 20, 2024 · 1 comment · Fixed by #3988
Closed

Static typing: Getting type errors on logger append_keys usage #3989

leandrodamascena opened this issue Mar 20, 2024 · 1 comment · Fixed by #3988
Labels
triage Pending triage from maintainers typing Static typing definition related issues (mypy, pyright, etc.)

Comments

@leandrodamascena
Copy link
Contributor

Static type checker used

pyright/pylance

AWS Lambda function runtime

3.12

Powertools for AWS Lambda (Python) version

latest

Static type checker info

On behalf of @rafrafek - #3869 (comment)

I have found another line causing problems when using Pyright in the strict mode:

Type of "append_keys" is "(**additional_keys: Unknown)

def append_keys(self, **additional_keys) -> None:

Do you know what type it should be annotated?

Code snippet

from aws_lambda_powertools import Logger
from aws_lambda_powertools.utilities.typing import LambdaContext

logger = Logger()

logger.append_keys(test="a")

Possible Solution

No response

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) Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Pending triage from maintainers typing Static typing definition related issues (mypy, pyright, etc.)
Projects
Status: Shipped
Development

Successfully merging a pull request may close this issue.

1 participant