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(metrics): AttributeError raised by MetricManager and Typing and docs #357

Merged
merged 8 commits into from Mar 25, 2021

Conversation

michaelbrewer
Copy link
Contributor

@michaelbrewer michaelbrewer commented Mar 24, 2021

Issue #, if available:

Description of changes:

Changes:

  • Correct typing to make mypy happier
  • Correct highlighted lines
  • fix(metrics): AttributeError raised when setting metadata_set
  • fix(parser): Use sys.version_info to determine where we need typing_extensions

Before

$ mypy aws_lambda_powertools
....
Found 126 errors in 29 files (checked 99 source files)

After

$ mypy aws_lambda_powertools
....
Found 52 errors in 18 files (checked 99 source files)

and ignore missing imports:

Found 32 errors in 10 files (checked 99 source files)

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:
- Correct typing to make mypy happier
- Correct highlighted lines
@michaelbrewer michaelbrewer changed the title chore(data-classes): Typing and docs chore(*): Typing and docs Mar 24, 2021
@michaelbrewer michaelbrewer changed the title chore(*): Typing and docs fix(metrics): AttributeError raised by MediaManager and Typing and docs Mar 24, 2021
@michaelbrewer
Copy link
Contributor Author

@heitorlessa MyPy found a bug for us :)

@codecov-io
Copy link

codecov-io commented Mar 25, 2021

Codecov Report

Merging #357 (2f3bd68) into develop (4211796) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #357   +/-   ##
========================================
  Coverage    99.94%   99.94%           
========================================
  Files           96       96           
  Lines         3642     3643    +1     
  Branches       174      175    +1     
========================================
+ Hits          3640     3641    +1     
  Partials         2        2           
Impacted Files Coverage Δ
aws_lambda_powertools/utilities/batch/base.py 100.00% <ø> (ø)
...wertools/utilities/idempotency/persistence/base.py 99.35% <ø> (ø)
...ambda_powertools/utilities/validation/validator.py 100.00% <ø> (ø)
aws_lambda_powertools/logging/lambda_context.py 100.00% <100.00%> (ø)
aws_lambda_powertools/logging/logger.py 100.00% <100.00%> (ø)
aws_lambda_powertools/metrics/base.py 100.00% <100.00%> (ø)
aws_lambda_powertools/metrics/metric.py 100.00% <100.00%> (ø)
aws_lambda_powertools/metrics/metrics.py 100.00% <100.00%> (ø)
aws_lambda_powertools/shared/functions.py 100.00% <100.00%> (ø)
aws_lambda_powertools/utilities/batch/sqs.py 100.00% <100.00%> (ø)
... and 10 more

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 4211796...2f3bd68. Read the comment docs.

@heitorlessa heitorlessa added area/metrics bug Something isn't working labels Mar 25, 2021
Copy link
Contributor

@heitorlessa heitorlessa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!!!!! Asking two minor changes only

aws_lambda_powertools/logging/logger.py Show resolved Hide resolved
aws_lambda_powertools/metrics/base.py Show resolved Hide resolved
aws_lambda_powertools/metrics/metric.py Show resolved Hide resolved
aws_lambda_powertools/metrics/metrics.py Outdated Show resolved Hide resolved
aws_lambda_powertools/metrics/metrics.py Show resolved Hide resolved
@heitorlessa heitorlessa merged commit 29497d4 into aws-powertools:develop Mar 25, 2021
@heitorlessa heitorlessa changed the title fix(metrics): AttributeError raised by MediaManager and Typing and docs fix(metrics): AttributeError raised by MetricManager and Typing and docs Mar 25, 2021
@michaelbrewer michaelbrewer deleted the chore-typing-docs branch March 25, 2021 09:15
heitorlessa referenced this pull request in heitorlessa/aws-lambda-powertools-python Apr 4, 2021
* develop:
  fix(idempotent): Correctly raise IdempotencyKeyError (#378)
  feat(event-handler): Add AppSync handler decorator (#363)
  feat(parameter): add dynamodb_endpoint_url for local_testing (#376)
  fix(parser): S3Model support empty keys (#375)
  fix(data-classes): Add missing operationName (#373)
  fix: perf tests for Logger and fail str msgs
  feat(parser): Add S3 Object Lambda Event (#362)
  build(pre-commit): Add pre-commit to make pr (#368)
  fix(tracer): Correct type hint for MyPy (#365)
  fix(metrics): AttributeError raised by MediaManager and Typing and docs (#357)

Signed-off-by: heitorlessa <lessa@amazon.co.uk>
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

Successfully merging this pull request may close these issues.

None yet

3 participants