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

PubsubIO: add readMessagesWithAttributesWithCoderAndParseFn #31206

Conversation

llamallamaduck
Copy link
Contributor

@llamallamaduck llamallamaduck commented May 7, 2024

This change adds readMessagesWithAttributesWithCoderAndParseFn that enables forwarding of the Pubsub message attributes to make them available when applying the provided ParseFn. The new method is similar to readMessagesWithCoderAndParseFn, but adds setNeedsAttributes(true).

Why?

The readMessagesWithCoderAndParseFn of PubsubIO skips forwarding the pubsub message attributes to the provided parse function. In the use case I am solving, the attributes of the message contain the schema fingerprint needed for the parsing.


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

github-actions bot commented May 7, 2024

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@llamallamaduck llamallamaduck force-pushed the read-msgs-with-parse-fn-include-attributes branch from 18cf95a to 321180c Compare May 8, 2024 07:47
@llamallamaduck
Copy link
Contributor Author

Some checks are failing with

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for 'opensource.org'. (_ssl.c:1131)>

Doesn't seem to relate to the changes in this PR.

assign set of reviewers

@llamallamaduck
Copy link
Contributor Author

assign set of reviewers

Copy link
Contributor

github-actions bot commented May 8, 2024

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

R: @m-trieu for label java.
R: @johnjcasey for label io.

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

github-actions bot commented May 8, 2024

Reviewers are already assigned to this PR: @m-trieu @johnjcasey

Copy link
Contributor

@labianchin labianchin left a comment

Choose a reason for hiding this comment

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

@llamallamaduck llamallamaduck force-pushed the read-msgs-with-parse-fn-include-attributes branch 2 times, most recently from 5667062 to e84f562 Compare May 15, 2024 13:02
@llamallamaduck llamallamaduck changed the title PubsubIO: setNeedsAttributes(true) when readMessagesWithCoderAndParseFn PubsubIO: add readMessagesWithAttributesWithCoderAndParseFn May 15, 2024
@llamallamaduck llamallamaduck force-pushed the read-msgs-with-parse-fn-include-attributes branch 3 times, most recently from 67662cd to 6b0a15c Compare May 15, 2024 14:45
@llamallamaduck llamallamaduck force-pushed the read-msgs-with-parse-fn-include-attributes branch from 6b0a15c to a5f80ff Compare May 16, 2024 12:54
Copy link
Contributor

@scwhittle scwhittle left a comment

Choose a reason for hiding this comment

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

Thanks!

@scwhittle
Copy link
Contributor

Will merge once presubmits have a chance to complete

@scwhittle scwhittle merged commit 88af35e into apache:master May 21, 2024
18 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.

None yet

3 participants