Skip to content

Bug: jmespath is an undeclared dependency of Logger utility #4340

Closed

Description

@TonySherman

Expected Behaviour

Powertools includes dependencies unless the feature states that it needs extras.

Current Behaviour

The Logger utility will not work without jmespath. Importing the logger causes the following error:
ModuleNotFoundError: No module named 'jmespath'

Code snippet

from aws_lambda_powertools.logging import Logger

logger = Logger()

logger.info('test')

Possible Solution

This issue is unlikely to cause problems in most cases. There are very few use cases where this code would be run somewhere that does not have jmespath available via boto/botocore.

It could be noted in the docs in the extra dependencies section.
image

Steps to Reproduce

  • Create a new virtual environment:
    python -m venv .venv
  • Activate environment
    source .venv/bin/activate
  • Install Powertools with no extras
    pip install aws-lambda-powertools
  • Run example code snippet.

Powertools for AWS Lambda (Python) version

latest

AWS Lambda function runtime

3.11

Packaging format used

PyPi

Debugging logs

No response

Activity

  1. added
    bug
    triage
    on May 16, 2024
  2. removed
    triage
    on May 18, 2024
  3. heitorlessa commented on May 18, 2024

    @heitorlessa
    Contributor

    Thanks a lot for opening the issue as discussed on discord ;)

    We'll add it for the next release

  4. github-actions commented on May 29, 2024

    @github-actions
    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.

  5. added
    pending-release
    on May 29, 2024
  6. moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python)on Jun 10, 2024
  7. moved this from Shipped to No status in Powertools for AWS Lambda (Python)on Jun 10, 2024
  8. github-actions commented on Jun 13, 2024

    @github-actions
    Contributor

    This is now released under 2.39.0 version!

  9. removed
    pending-release
    on Jun 13, 2024
  10. moved this from Coming soon to Shipped in Powertools for AWS Lambda (Python)on Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions