Skip to content

Conversation

@czechnology
Copy link
Contributor

Issue number: closes #7581

Summary

The docstring is correct but the type hint is not.

The underlying AmazonCloudWatchEMFProvider.set_timestamp supports both int and datetime.datetime.

Changes

Just a minor fix: extend type from int to int | datetime.datetime.

User experience

No more type warnings if an instance of datetime.datetime is passed to Metrics.set_timestamp().


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.

The docstring is correct but the type hint is not.

The underlying AmazonCloudWatchEMFProvider.set_timestamp supports both
int and datetime.datetime.
@czechnology czechnology requested a review from a team as a code owner October 26, 2025 18:50
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 26, 2025

Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need.
In the meantime, check out the #python channel on our Powertools for AWS Lambda Discord: Invite link

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 26, 2025
@sonarqubecloud
Copy link

Copy link
Contributor

@leandrodamascena leandrodamascena left a comment

Choose a reason for hiding this comment

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

Thanks for fixing that! APPROVED!

@codecov
Copy link

codecov bot commented Oct 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.49%. Comparing base (fd6865d) to head (005d126).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7582   +/-   ##
========================================
  Coverage    96.49%   96.49%           
========================================
  Files          275      275           
  Lines        13110    13110           
  Branches       985      985           
========================================
  Hits         12650    12650           
  Misses         356      356           
  Partials       104      104           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leandrodamascena leandrodamascena merged commit 117dc26 into aws-powertools:develop Oct 27, 2025
14 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Oct 27, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metrics 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.

Static typing: Metrics.set_timestamp does not allow datetime.datetime, although supported

2 participants