Fix OnWindowExpirationContext. - #38878
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces support for the OnWindowExpirationContext parameter within Apache Beam's DoFn framework. By updating the reflection-based invoker factory and signature validation logic, it enables users to access context-specific information during window expiration events, improving the flexibility of stateful processing. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
R: @ahmedabu98 |
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
There was a problem hiding this comment.
Code Review
This pull request introduces support for the OnWindowExpirationContext parameter in @OnWindowExpiration methods of DoFn. It updates the reflection and code generation utilities, including ByteBuddyDoFnInvokerFactory, DoFnInvoker, and DoFnSignatures, to recognize, dispatch, and supply this parameter, and adds corresponding unit tests. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request adds support for the OnWindowExpirationContext parameter in @OnWindowExpiration methods of DoFn across runners, signature parsing, and invoker generation. The feedback suggests using JUnit's assertNotNull instead of Guava's Preconditions.checkNotNull in the unit tests to ensure idiomatic assertions and clearer test failures.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| Integer currentValue = MoreObjects.firstNonNull(state.read(), 0); | ||
| // verify state | ||
| assertEquals(1, (int) currentValue); | ||
| Preconditions.checkNotNull(context); |
There was a problem hiding this comment.
In unit tests, it is more idiomatic to use JUnit's assertNotNull instead of Guava's Preconditions.checkNotNull. Preconditions.checkNotNull throws a NullPointerException (which JUnit treats as an unexpected error), whereas assertNotNull throws an AssertionError (which JUnit treats as a test failure), providing better integration with test runners and clearer test results.
| Preconditions.checkNotNull(context); | |
| assertNotNull(context); |
* foo * fix compilation * fix compilation
addresses #38875