Skip to content

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

Closed
@TonySherman

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

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

Status

Shipped

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions