Skip to content

fix readFromKafka schema error - #40023

Open
derrickaw wants to merge 8 commits into
apache:masterfrom
derrickaw:20260904_readFromkafkaIssue#35186
Open

derrickaw wants to merge 8 commits into
apache:masterfrom
derrickaw:20260904_readFromkafkaIssue#35186

Conversation

@derrickaw

Copy link
Copy Markdown
Collaborator

fixes #35186


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.

@derrickaw

Copy link
Copy Markdown
Collaborator Author

hold on this one until #40396 is merged

@derrickaw
derrickaw force-pushed the 20260904_readFromkafkaIssue#35186 branch from 301277e to 7e10f74 Compare October 9, 2026 01:43
@codecov

codecov Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.53846% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.85%. Comparing base (76f6e6d) to head (3057c82).
⚠️ Report is 232 commits behind head on master.

Files with missing lines Patch % Lines
...a/org/apache/beam/sdk/schemas/utils/YamlUtils.java 50.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #40023      +/-   ##
============================================
+ Coverage     56.16%   58.85%   +2.68%     
- Complexity     2288    13997   +11709     
============================================
  Files          1124     2595    +1471     
  Lines        178336   272794   +94458     
  Branches       1489    11316    +9827     
============================================
+ Hits         100170   160548   +60378     
- Misses        75645   106214   +30569     
- Partials       2521     6032    +3511     
Flag Coverage Δ
java 65.06% <50.00%> (-10.73%) ⬇️
python 80.04% <100.00%> (+0.49%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 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.

@derrickaw

Copy link
Copy Markdown
Collaborator Author

/gemini review

@github-actions github-actions Bot left a comment

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.

📋 Review Summary

This PR resolves issue #35186 by enabling YAML map and list structures to be serialized into JSON strings when mapped to a STRING schema field in both Java (YamlUtils) and Python (ExplicitSchemaTransformPayloadBuilder). This allows users to specify inline structured schemas (e.g., JSON or Avro schemas) in ReadFromKafka and WriteToKafka YAML configurations without needing to format them as literal YAML block strings.

🔍 General Feedback

  • The implementation in both Java and Python is clean, idiomatic, and consistent across both SDKs.
  • Unit and integration test coverage is thorough, covering YamlUtils, ExplicitSchemaTransformPayloadBuilder, Managed Kafka transforms, and end-to-end YAML pipeline expansion.

💡 Tip: Comment /gemini review on this pull request to trigger a new Gemini code review.

@derrickaw
derrickaw marked this pull request as ready for review October 19, 2026 17:52
@github-actions

Copy link
Copy Markdown
Contributor

Assigning reviewers:

R: @chamikaramj for label yaml.
Backup reviewer: Abacn (if the main reviewer is unresponsive, you can escalate to them by tagging their username)

This pull request likely touches a core component ("core" label). Please review with scrutiny.

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

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.

[Bug]: ReadFromKafka YAML transform cannot specify JSON schema

1 participant