Skip to content

Fix coder encode decode javadoc#37963

Closed
Subramanya-Veeregowda wants to merge 0 commit into
apache:masterfrom
Subramanya-Veeregowda:fix-coder-encode-decode-javadoc
Closed

Fix coder encode decode javadoc#37963
Subramanya-Veeregowda wants to merge 0 commit into
apache:masterfrom
Subramanya-Veeregowda:fix-coder-encode-decode-javadoc

Conversation

@Subramanya-Veeregowda

Copy link
Copy Markdown
Contributor

Improved Javadoc for Context in Coder class.

  • Added proper summary line to satisfy Checkstyle
  • Clarified OUTER vs NESTED usage with examples
  • Fixed formatting and @deprecated usage

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 primarily focuses on enhancing documentation across two key areas: improving the Javadoc for the Coder class in Java to clarify the usage and purpose of Context in encoding and decoding operations, and expanding the Python programming guide with new examples for advanced field selection patterns. The changes aim to provide clearer guidance and better understanding for developers using these functionalities.

Highlights

  • Improved Javadoc for Coder.Context: The Javadoc for the Coder.Context class has been significantly enhanced, including a proper summary line, clearer explanations of OUTER vs NESTED contexts, and practical usage examples. Redundant Javadoc for individual fields within Context was removed as the class-level documentation now covers their meaning.
  • Enhanced Coder encode and decode Javadoc: The Javadoc for both the encode and decode methods in the Coder class has been updated. This includes better descriptions of how values are handled, the importance of boundary information for multiple elements, and how Context influences encoding/decoding. The @deprecated messages for context-aware methods were also refined.
  • Added Python SDK documentation examples: New examples have been added to the programming guide for the Python SDK, demonstrating how to use wildcard selection for nested fields, select nested fields within arrays, and select specific keys from map fields.

🧠 New Feature in Public Preview: You can now enable Memory 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize 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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. 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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions

Copy link
Copy Markdown
Contributor

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

@Subramanya-Veeregowda

Subramanya-Veeregowda commented Mar 28, 2026

Copy link
Copy Markdown
Contributor Author

Re-running CI. The failure appears in macOS tests and seems unrelated to the Javadoc changes.

I'll wait for the rerun results, but please let me know if I should investigate further.

@Subramanya-Veeregowda

Copy link
Copy Markdown
Contributor Author

Why checks are stuck should I draft and recommit again?

Any further improvements needed?

Open to improve if any specific improvements needed

@Subramanya-Veeregowda Subramanya-Veeregowda force-pushed the fix-coder-encode-decode-javadoc branch from a721623 to 7609051 Compare March 30, 2026 14:40
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @kennknowles for label java.

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

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

@stankiewicz

Copy link
Copy Markdown
Contributor

@Subramanya-Veeregowda pr is empty, should we close it or are you planning to continue working on this?

@Subramanya-Veeregowda

Copy link
Copy Markdown
Contributor Author

a local issue where i added javadoc may be the file is not added, Sorry for the empty PR, i will update it ASAP!

@Subramanya-Veeregowda Subramanya-Veeregowda left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@stankiewicz Can you tell me why my checks are failing and what is the issue, I am new into this world so i can't figure it out on my own if there are any specific needs for improvements i would like to work on it

@codecov

codecov Bot commented Apr 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.84%. Comparing base (97c2faf) to head (25af774).
⚠️ Report is 82 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #37963      +/-   ##
============================================
- Coverage     57.34%   56.84%   -0.50%     
+ Complexity     5115     3426    -1689     
============================================
  Files          1392     1178     -214     
  Lines        197103   187943    -9160     
  Branches       4817     3593    -1224     
============================================
- Hits         113020   106841    -6179     
+ Misses        80247    77710    -2537     
+ Partials       3836     3392     -444     
Flag Coverage Δ
java 71.94% <ø> (+1.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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stankiewicz

Copy link
Copy Markdown
Contributor

@stankiewicz Can you tell me why my checks are failing and what is the issue, I am new into this world so i can't figure it out on my own if there are any specific needs for improvements i would like to work on it

start with PreCommit Spotless -
https://github.com/apache/beam/actions/runs/24007159669/job/70012618083?pr=37963
in logs it states which file has a problem and how to fix code formatting.

Before submitting PR, it's worth setting up environment - following guides can help you:

There are also agent skills added that will help you finding some gradle tasks, like spotless. works really well with gemini cli and antigravity.

@github-actions github-actions Bot added build and removed java labels Apr 10, 2026
@github-actions github-actions Bot added java and removed build labels Apr 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Reminder, please take a look at this pr: @kennknowles

@stankiewicz

Copy link
Copy Markdown
Contributor

waiting on Author

Comment thread .gitignore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't be part of commit

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

there a lot of duplicate javadoc, please simplify it a bit.

@@ -37,7 +37,9 @@
import org.checkerframework.checker.nullness.qual.Nullable;

/**
* A {@link Coder Coder&lt;T&gt;} defines how to encode and decode values of type {@code T} into
* Use {@link CoderProperties} to verify the correctness of a {@link Coder} implementation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

does have to be first sentence?

@@ -52,6 +54,18 @@
* <p>All methods of a {@link Coder} are required to be thread safe.
*
* @param <T> the type of values being encoded and decoded
*
* <p>When implementing a {@link Coder}, it is important to understand the role

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it have to be part of this javadoc?

* include sufficient length information (such as prefixes) to allow correct
* decoding of subsequent values.
*
* <p>Use {@link CoderProperties} in tests to verify correctness, determinism,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -60,6 +74,14 @@ public abstract class Coder<T> implements Serializable {
* @deprecated To implement a coder, do not use any {@link Context}. Just implement only those
* abstract methods which do not accept a {@link Context} and leave the default
* implementations for methods accepting a {@link Context}.
* <p>There are two common contexts:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why "common"?

* <p>The encoding behavior depends on the {@link Context}:
*
* <ul>
* <li>In {@link Context#OUTER}, the value occupies the remainder of the stream, so no

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

those descriptions are inconsistent.

* @throws IOException if writing to the {@code OutputStream} fails for some reason
* @throws CoderException if the value could not be encoded for some reason
*
* <p>Implementers must ensure that encoding in {@link Context#NESTED}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this is duplicate but written slightly differently.

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