Skip to content
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

Bug: Missing dependency jsonpath_ng for Data Masking in package version 3.3.0 #5715

Closed
tzahari opened this issue Dec 10, 2024 · 4 comments
Closed
Assignees
Labels
bug Something isn't working triage Pending triage from maintainers

Comments

@tzahari
Copy link

tzahari commented Dec 10, 2024

Expected Behaviour

Usage of the DataMasking tool is working without import error.

Current Behaviour

The following error occurred:
ModuleNotFoundError: No module named 'jsonpath_ng'

Code snippet

from aws_lambda_powertools.utilities.data_masking import DataMasking

data_masker = DataMasking()
data = {'password': 'secret!', 'login': 'login1'}
erased = data_masker.erase(data, fields=["password"])
print(erased)

Possible Solution

Add jsonpath_ng to the package dependencies

Steps to Reproduce

  1. install powertools version 3.3.0
  2. run the example script

Powertools for AWS Lambda (Python) version

3.3.0

AWS Lambda function runtime

3.12

Packaging format used

PyPi

Debugging logs

@tzahari tzahari added bug Something isn't working triage Pending triage from maintainers labels Dec 10, 2024
Copy link

boring-cyborg bot commented Dec 10, 2024

Thanks for opening your first issue here! We'll come back to you as soon as we can.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@anafalcao
Copy link
Collaborator

Hi @tzahari ! The DataMasking utility requires some additional dependencies that aren't included in the core package.

To resolve this issue, you'll need to ensure you're installing the datamasking extras. Here's how you can do that:

If you're installing directly with pip, for example:
pip install "aws-lambda-powertools[datamasking]"

This will ensure all necessary dependencies, including jsonpath-ng, are installed. You can find more information about this in our documentation: https://docs.powertools.aws.dev/lambda/python/latest/utilities/data_masking/#install

We appreciate you taking the time to report this. It's a great opportunity to clarify this aspect of Powertools and hopefully help other users who might encounter the same situation. Let us know if you have any further questions or if you need any more assistance!

@anafalcao anafalcao self-assigned this Dec 11, 2024
@tzahari
Copy link
Author

tzahari commented Dec 11, 2024

Hi @anafalcao ,
Thanks for this head up. I missed that in the documentation... sorry for that.
Maybe move the DataMasking part completely into the extra package?
Best Regards

@tzahari tzahari closed this as completed Dec 11, 2024
@github-project-automation github-project-automation bot moved this from Triage to Coming soon in Powertools for AWS Lambda (Python) Dec 11, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Pending triage from maintainers
Projects
Status: Coming soon
Development

No branches or pull requests

2 participants