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_sources): change partition and offset field types in KafkaEventRecord #4515

Conversation

scampbell5
Copy link

@scampbell5 scampbell5 commented Jun 13, 2024

Issue number: #4504

Summary

Changes

Updated offset and partition properties to be an int type instead of str on the KafkaEventRecord class.

User experience

from aws_lambda_powertools.utilities.data_classes import event_source, KafkaEvent

@event_source(data_class=KafkaEvent)
def lambda_handler(event: KafkaEvent, context):
    assert isinstance(event.record.offset, int)
    assert isinstance(event.record.partition, int)

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.

@scampbell5 scampbell5 requested a review from a team as a code owner June 13, 2024 22:54
Copy link

boring-cyborg bot commented Jun 13, 2024

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 Jun 13, 2024
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@scampbell5 scampbell5 changed the title fix: Change partition and offset on the KafkaEventRecord to be an int… fix(event_sources): Change partition and offset on the KafkaEventRecord to be an int… Jun 13, 2024
@leandrodamascena leandrodamascena changed the title fix(event_sources): Change partition and offset on the KafkaEventRecord to be an int… fix(event_sources): change partition and offset field types in KafkaEventRecord Jun 13, 2024
@github-actions github-actions bot added the bug Something isn't working label Jun 13, 2024
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.43%. Comparing base (e14e768) to head (cf74437).
Report is 571 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4515      +/-   ##
===========================================
+ Coverage    96.38%   96.43%   +0.05%     
===========================================
  Files          214      219       +5     
  Lines        10030    10626     +596     
  Branches      1846     1976     +130     
===========================================
+ Hits          9667    10247     +580     
- Misses         259      267       +8     
- Partials       104      112       +8     

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

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 submitting this PR so quickly @scampbell5!

APPROVED!

@leandrodamascena leandrodamascena merged commit e54cabd into aws-powertools:develop Jun 13, 2024
23 checks passed
Copy link

boring-cyborg bot commented Jun 13, 2024

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
bug Something isn't working 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.

Bug: KafkaEventRecord Incorrect types for offset and partition properties
2 participants