Skip to content

fix(capture_method): should yield inside with for generator method using a context manager #124

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

Merged

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented Aug 22, 2020

Changes:

  • capture_method should yield from within the "with" statement
  • Add missing test cases

Closes #112

Issue #, if available:
#112

Description of changes:

Checklist

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

Changes:
* capture_method should yield from within the "with" statement
* Add missing test cases

Closes #112
@codecov-commenter
Copy link

codecov-commenter commented Aug 22, 2020

Codecov Report

Merging #124 into develop will increase coverage by 1.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##           develop      #124      +/-   ##
============================================
+ Coverage    98.99%   100.00%   +1.00%     
============================================
  Files           24        24              
  Lines          698       698              
  Branches        64        64              
============================================
+ Hits           691       698       +7     
+ Misses           7         0       -7     
Impacted Files Coverage Δ
aws_lambda_powertools/tracing/tracer.py 100.00% <100.00%> (+4.14%) ⬆️

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 6736af2...3101a4d. Read the comment docs.

@michaelbrewer michaelbrewer changed the title fix(capture_method): should yield inside with fix(capture_method): should yield inside with for generator method using a context manager Aug 22, 2020
@to-mc to-mc self-requested a review August 22, 2020 08:49
@to-mc to-mc merged commit 14f6dfe into aws-powertools:develop Aug 22, 2020
michaelbrewer referenced this pull request in gyft/aws-lambda-powertools-python Aug 22, 2020
Changes:
* capture_method should yield from within the "with" statement
* Add missing test cases

Closes #112
heitorlessa referenced this pull request in heitorlessa/aws-lambda-powertools-python Aug 22, 2020
* develop:
  chore: version bump to 1.3.1
  fix(capture_method): should yield inside with (#124)
  chore: bump version to 1.3.0 (#122)
  chore(deps): bump prismjs from 1.20.0 to 1.21.0 in /docs
  chore(deps): bump elliptic from 6.5.2 to 6.5.3 in /docs
  feat: add parameter utility (#96)
  chore: bump version to 1.2.0 (#119)
  feat: add support for tracing of generators using capture_method decorator (#113)
nmoutschen pushed a commit that referenced this pull request Aug 24, 2020
* fix(ssm): Make decrypt an explicit option

* chore: declare as self

* fix: update get_parameter and get_parameters

Changes:
ssm.py - get_parameters - pass through the **sdk_options and merge in
the recursive and decrypt params
ssm.py - get_parameter - add explicit option for decrypt

* chore: fix typos and type hinting

* tests: verify that the default kwargs are set

- `decrypt` should be false by default
- `recursive` should be true by default

* fix(capture_method): should yield inside with (#124)

Changes:
* capture_method should yield from within the "with" statement
* Add missing test cases

Closes #112

* chore: version bump to 1.3.1

* refactor: reduce get_multiple complexity

Changes:
- base.py - update get_multiple to reduce the overall complexity
- base.py - `_has_not_expired` returns whether a key exists and has not expired
- base.py - `transform_value` add `raise_on_transform_error` and default to True
- test_utilities_parameters.py - Add a direct test of transform_value

* refactor: revert to a regular for each

Changes:
* Add type hint to `values` as it can change later on in transform
* Use a slightly faster and easier to read for each over dict
  comprehension

Co-authored-by: Tom McCarthy <[email protected]>
@michaelbrewer michaelbrewer deleted the fix-context-manager-plus-generator branch August 25, 2020 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@tracer.capture_lambda_handler does not support functions that return generator expressions
3 participants