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

Add an ExtractWindowingInfo transform. #34051

Merged
merged 5 commits into from
Feb 25, 2025
Merged

Conversation

robertwb
Copy link
Contributor

YAML users don't have access to DoFn params or annotations, so we provide this as an explicit transform.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @damccorm for label python.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

Thanks! Feedback is minor (string fixes), otherwise LGTM.

Please fix linting as well before merging



_WINDOWING_INFO_TYPES = {
'timestamp': Timestamp,
Copy link
Contributor

Choose a reason for hiding this comment

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

(optional, not sure if I like this more) - thoughts on event_timestamp? It might be a little more explicit.

We could even allow a user to specify processing_timestamp (resolves to time.time()) as a convenience.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting idea.

I'm going to leave it as timestamp. Event timestamps are actually attached to the element, and windows are always in terms of this time. It's also a bit deceptive because if I try to inspect/reify processing time, that's not what will be used when anything else tries to act on it. (In addition, one needs triggers/timers to get into processing time and that's a whole can of worms we don't expose to YAML.)

Copy link

codecov bot commented Feb 25, 2025

Codecov Report

Attention: Patch coverage is 89.18919% with 4 lines in your changes missing coverage. Please review.

Project coverage is 57.69%. Comparing base (8031f09) to head (86795a0).
Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
sdks/python/apache_beam/yaml/yaml_mapping.py 89.18% 4 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #34051      +/-   ##
============================================
+ Coverage     57.63%   57.69%   +0.06%     
  Complexity     1474     1474              
============================================
  Files           989      993       +4     
  Lines        157126   157354     +228     
  Branches       1076     1076              
============================================
+ Hits          90564    90790     +226     
- Misses        64320    64322       +2     
  Partials       2242     2242              
Flag Coverage Δ
python 81.27% <89.18%> (+0.05%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@robertwb robertwb merged commit 82d3d8d into apache:master Feb 25, 2025
94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants