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

make docs-api-local fails for the utilities docs #611

Closed
michaelbrewer opened this issue Aug 15, 2021 · 4 comments
Closed

make docs-api-local fails for the utilities docs #611

michaelbrewer opened this issue Aug 15, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@michaelbrewer
Copy link
Contributor

michaelbrewer commented Aug 15, 2021

When running make docs-api-local I get the following error when browsing the docs for the utilities

Error importing module aws_lambda_powertools.utilities:

Traceback (most recent call last):
  File "/Volumes/data/projects/aws-lambda-powertools-python/.venv/lib/python3.8/site-packages/pdoc/cli.py", line 234, in do_GET
    out = self.html()
  File "/Volumes/data/projects/aws-lambda-powertools-python/.venv/lib/python3.8/site-packages/pdoc/cli.py", line 266, in html
    return pdoc.html(self.import_path_from_req_url,
  File "/Volumes/data/projects/aws-lambda-powertools-python/.venv/lib/python3.8/site-packages/pdoc/__init__.py", line 173, in html
    mod = Module(import_module(module_name, reload=reload),
  File "/Volumes/data/projects/aws-lambda-powertools-python/.venv/lib/python3.8/site-packages/pdoc/__init__.py", line 234, in import_module
    importlib.reload(mod)
  File "/opt/homebrew/Cellar/python@3.8/3.8.11/Frameworks/Python.framework/Versions/3.8/lib/python3.8/importlib/__init__.py", line 169, in reload
    _bootstrap._exec(spec, module)
  File "<frozen importlib._bootstrap>", line 604, in _exec
  File "<frozen importlib._bootstrap_external>", line 843, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Volumes/data/projects/aws-lambda-powertools-python/aws_lambda_powertools/utilities/parser/models/apigw.py", line 46, in <module>
    class APIGatewayEventRequestContext(BaseModel):
  File "/Volumes/data/projects/aws-lambda-powertools-python/aws_lambda_powertools/utilities/parser/models/apigw.py", line 72, in APIGatewayEventRequestContext
    def check_message_id(cls, values):
  File "/Volumes/data/projects/aws-lambda-powertools-python/.venv/lib/python3.8/site-packages/pydantic/class_validators.py", line 119, in root_validator
    f_cls = _prepare_validator(_func, allow_reuse)
  File "/Volumes/data/projects/aws-lambda-powertools-python/.venv/lib/python3.8/site-packages/pydantic/class_validators.py", line 144, in _prepare_validator
    raise ConfigError(f'duplicate validator function "{ref}"; if this is intended, set `allow_reuse=True`')
pydantic.errors.ConfigError: duplicate validator function "aws_lambda_powertools.utilities.parser.models.apigw.APIGatewayEventRequestContext.check_message_id"; if this is intended, set `allow_reuse=True`

What were you trying to accomplish?

Local testing of the API Docs

Expected Behavior

No errors

Current Behavior

Errors

Possible Solution

Add allow_reuse=True as suggested. (Or some other better fix @risenberg-cyberark ?)

Steps to Reproduce (for bugs)

  1. run make dev docs-api-local
  2. visit http://localhost:8080/aws_lambda_powertools/utilities/

Environment

  • Powertools version used: 1.19.0
  • Packaging format (Layers, PyPi): Git
  • AWS Lambda function runtime: Python 3.8.11 locally
  • Debugging logs
@michaelbrewer michaelbrewer added bug Something isn't working triage Pending triage from maintainers labels Aug 15, 2021
@michaelbrewer michaelbrewer changed the title API Docs fail make docs-api-local fails for the utilities docs Aug 15, 2021
@michaelbrewer
Copy link
Contributor Author

@heitorlessa @risenberg-cyberark I am not sure why this suddenly started, and I am sure my fix it not right. But it does at least render the docs

@michaelbrewer
Copy link
Contributor Author

@heitorlessa i need some help confirming the fix for this.

@heitorlessa
Copy link
Contributor

heitorlessa commented Aug 19, 2021 via email

@michaelbrewer
Copy link
Contributor Author

@heitorlessa - if it is not happening it might be my setup running Python 3.9.6 on MacArm. :P

@heitorlessa heitorlessa removed the triage Pending triage from maintainers label Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants