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

fix(event_handlers): ImportError when importing Response from top-level event_handler #1388

Merged
merged 2 commits into from
Jul 27, 2022

Conversation

VictorCovalski
Copy link
Contributor

@VictorCovalski VictorCovalski commented Jul 27, 2022

Issue number: #1389

Summary

The docs mention a Response that allows one to customize a Response that gets returned to API Gateway

https://awslabs.github.io/aws-lambda-powertools-python/latest/core/event_handler/api_gateway/#fine-grained-responses

However, in the current version the Response object is not included in the __init__.py file located in the event_handler sub package. This PR fixes that.

Changes

Very minor.

User experience

None. It will match what the documentation mentions.

Checklist

If your change doesn't seem to apply, please leave them unchecked.

Is this a breaking change?

RFC issue number:

Checklist:

  • Migration process documented
  • Implement warnings (if it can live side by side)

Acknowledgment

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@VictorCovalski VictorCovalski requested a review from a team as a code owner July 27, 2022 17:47
@VictorCovalski VictorCovalski requested review from heitorlessa and removed request for a team July 27, 2022 17:47
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 27, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 27, 2022

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.

@codecov-commenter
Copy link

codecov-commenter commented Jul 27, 2022

Codecov Report

Merging #1388 (9eaba52) into develop (7414df7) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1388   +/-   ##
========================================
  Coverage    99.88%   99.88%           
========================================
  Files          119      119           
  Lines         5429     5429           
  Branches       620      620           
========================================
  Hits          5423     5423           
  Misses           2        2           
  Partials         4        4           
Impacted Files Coverage Δ
aws_lambda_powertools/event_handler/__init__.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c463232...9eaba52. Read the comment docs.

@heitorlessa
Copy link
Contributor

heitorlessa commented Jul 27, 2022

Thank you @VictorCovalski for spotting this, our automated linting for documentation somehow missed that. I'm creating a quick bug report to associate this fix with, and should merge soon.

Unless you deem it to be critical to warrant a patch release today, you should be able to import Response from api_gateway package:

from aws_lambda_powertools.event_handler.api_gateway import Response

We should make a release on Friday by EOD with this fix either way.

@heitorlessa heitorlessa changed the title fix import for Response class fix(event_handlers): ImportError when importing Response from top-level event_handler Jul 27, 2022
@heitorlessa heitorlessa added the bug Something isn't working label Jul 27, 2022
@VictorCovalski
Copy link
Contributor Author

Thank you @VictorCovalski for spotting this, our automated linting for documentation somehow missed that. I'm creating a quick bug report to associate this fix with, and should merge soon.

Unless you deem it to be critical to warrant a patch release today, you should be able to import Response from api_gateway package:

from aws_lambda_powertools.event_handler.api_gateway import Response

We should make a release on Friday by EOD with this fix either way.

Thanks for the quick reply @heitorlessa. I'll follow your suggestion until the next release.

@heitorlessa
Copy link
Contributor

Merging. It's great to hear from another fellow Brazilian (muito obrigado!!).

@heitorlessa heitorlessa merged commit 279ba24 into aws-powertools:develop Jul 27, 2022
@boring-cyborg
Copy link

boring-cyborg bot commented Jul 27, 2022

Awesome work, congrats on your first merged pull request and thank you for helping improve everyone's experience!

heitorlessa added a commit that referenced this pull request Jul 27, 2022
…tools-python into develop

* 'develop' of https://github.com/awslabs/aws-lambda-powertools-python:
  fix(event_handlers): ImportError when importing Response from top-level event_handler (#1388)
@heitorlessa
Copy link
Contributor

Thanks to your @VictorCovalski PR, we've identified that static analysis (mypy) weren't including examples in the doc. I've just created a PR to fix 50 other errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working event_handlers size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants