You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "jason810496 (via GitHub)" <gi...@apache.org> on 2026/03/08 06:06:06 UTC
[PR] [Code Review] Support UnboundSource [beam]
jason810496 opened a new pull request, #37796:
URL: https://github.com/apache/beam/pull/37796
(no comment)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Code Review] Support UnboundSource [beam]
Posted by "gemini-code-assist[bot] (via GitHub)" <gi...@apache.org>.
gemini-code-assist[bot] commented on PR #37796:
URL: https://github.com/apache/beam/pull/37796#issuecomment-4018438552
## Summary of Changes
Hello, I'm Gemini Code Assist[^1]! 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 significantly enhances Apache Beam's capabilities for defining custom streaming data sources by introducing a robust `UnboundedSource` API in Python, mirroring existing Java functionality. It provides the foundational abstract classes, a Splittable DoFn wrapper for seamless pipeline integration, and practical examples in both Java and Python. Additionally, a new `PeriodicImpulseSource` is included to demonstrate a real-world application of the new API, ensuring comprehensive support for checkpointing, watermarking, and efficient processing of unbounded data streams.
### Highlights
* **Java UnboundedSource Demo**: A new Java example, `UnboundedSourceDemo.java`, has been added to demonstrate how to implement a custom `UnboundedSource` with support for checkpointing, watermarks, and record IDs. This example generates a finite sequence of integers and includes various pipeline tests.
* **Python UnboundedSource API Implementation**: The core `UnboundedSource`, `UnboundedReader`, and `CheckpointMark` abstract base classes have been introduced in `sdks/python/apache_beam/io/iobase.py`. This includes the necessary Splittable DoFn (SDF) wrapper infrastructure to enable these custom sources to run within Beam pipelines, handling restriction tracking, watermarking, and checkpointing.
* **Python UnboundedSource Demo**: A new Python example, `unbounded_source_demo.py`, has been added. It is the Python counterpart to the Java demo, showcasing a custom `UnboundedSource` that generates integers with timestamps, watermarks, and checkpointing, along with correctness verification.
* **Python PeriodicImpulseSource**: A new native Python streaming IO, `PeriodicImpulseSource`, has been implemented. This `UnboundedSource` generates time-based impulses at regular intervals, serving as a useful streaming trigger or heartbeat source, and demonstrates practical usage of the new API.
* **Comprehensive Testing**: Extensive unit and end-to-end tests have been added in `sdks/python/apache_beam/io/unbounded_source_test.py` to validate the functionality of the new Python `UnboundedSource` API, its SDF wrapper, and the `PeriodicImpulseSource`.
🧠**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](https://codeassist.google/code-review/login) to enable Memory in your admin console.**
<details>
<summary><b>Changelog</b></summary>
* **examples/java/src/main/java/org/apache/beam/examples/UnboundedSourceDemo.java**
* Added a new Java example demonstrating a custom `UnboundedSource` with checkpointing and watermarking.
* **examples/python/unbounded_source_demo.py**
* Added a new Python example for a custom `UnboundedSource`, mirroring the Java demo.
* **sdks/python/apache_beam/io/__init__.py**
* Updated imports to expose new `UnboundedSource`, `UnboundedReader`, and `CheckpointMark` classes.
* **sdks/python/apache_beam/io/iobase.py**
* Introduced abstract base classes for `CheckpointMark`, `UnboundedSource`, and `UnboundedReader`.
* Implemented the Splittable DoFn (SDF) wrapper for `UnboundedSource` to enable its execution within Beam pipelines, including restriction tracking and watermark estimation.
* **sdks/python/apache_beam/io/periodic_impulse_source.py**
* Added a new `UnboundedSource` implementation, `PeriodicImpulseSource`, which generates time-based impulses.
* **sdks/python/apache_beam/io/unbounded_source_test.py**
* Added comprehensive unit and end-to-end tests for the new `UnboundedSource` API and its SDF wrapper, as well as for `PeriodicImpulseSource`.
</details>
<details>
<summary><b>Activity</b></summary>
* No activity has been recorded on this pull request yet.
</details>
<details>
<summary><b>Using Gemini Code Assist</b></summary>
<br>
The full guide for Gemini Code Assist can be found on our [documentation page](https://developers.google.com/gemini-code-assist/docs/review-github-code), here are some quick tips.
<b>Invoking Gemini</b>
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.
<b>Customization</b>
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](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github).
<b>Limitations & Feedback</b>
Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with :thumbsup: and :thumbsdown: 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](https://google.qualtrics.com/jfe/form/SV_2cyuGuTWsEw84yG).
<b>You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the [Gemini Code Assist IDE Extension](https://cloud.google.com/products/gemini/code-assist).</b>
</details>
[^1]: Review the [Privacy Notices](https://policies.google.com/privacy), [Generative AI Prohibited Use Policy](https://policies.google.com/terms/generative-ai/use-policy), [Terms of Service](https://policies.google.com/terms), and learn how to configure Gemini Code Assist in GitHub [here](https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github). Gemini can make mistakes, so double check it and [use code with caution](https://support.google.com/legal/answer/13505487).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Create PR by mistake [beam]
Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #37796:
URL: https://github.com/apache/beam/pull/37796#issuecomment-4018497343
## [Codecov](https://app.codecov.io/gh/apache/beam/pull/37796?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:x: Patch coverage is `80.91168%` with `67 lines` in your changes missing coverage. Please review.
:white_check_mark: Project coverage is 56.91%. Comparing base ([`26b18c6`](https://app.codecov.io/gh/apache/beam/commit/26b18c6e6f14e13082e565f6ef5e766d294fa25f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`6c62a4b`](https://app.codecov.io/gh/apache/beam/commit/6c62a4bb6355f35f9000abf05cc36034e1b375db?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 68 commits behind head on master.
| [Files with missing lines](https://app.codecov.io/gh/apache/beam/pull/37796?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Patch % | Lines |
|---|---|---|
| [sdks/python/apache\_beam/io/iobase.py](https://app.codecov.io/gh/apache/beam/pull/37796?src=pr&el=tree&filepath=sdks%2Fpython%2Fapache_beam%2Fio%2Fiobase.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vaW9iYXNlLnB5) | 79.29% | [59 Missing :warning: ](https://app.codecov.io/gh/apache/beam/pull/37796?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
| [...s/python/apache\_beam/io/periodic\_impulse\_source.py](https://app.codecov.io/gh/apache/beam/pull/37796?src=pr&el=tree&filepath=sdks%2Fpython%2Fapache_beam%2Fio%2Fperiodic_impulse_source.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#diff-c2Rrcy9weXRob24vYXBhY2hlX2JlYW0vaW8vcGVyaW9kaWNfaW1wdWxzZV9zb3VyY2UucHk=) | 87.30% | [8 Missing :warning: ](https://app.codecov.io/gh/apache/beam/pull/37796?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## master #37796 +/- ##
=============================================
+ Coverage 40.08% 56.91% +16.82%
Complexity 3416 3416
=============================================
Files 1177 1179 +2
Lines 187315 187877 +562
Branches 3588 3588
=============================================
+ Hits 75090 106930 +31840
+ Misses 108833 77555 -31278
Partials 3392 3392
```
| [Flag](https://app.codecov.io/gh/apache/beam/pull/37796/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [python](https://app.codecov.io/gh/apache/beam/pull/37796/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `80.07% <80.91%> (+40.33%)` | :arrow_up: |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/beam/pull/37796?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Code Review] Support UnboundSource [beam]
Posted by "jason810496 (via GitHub)" <gi...@apache.org>.
jason810496 closed pull request #37796: [Code Review] Support UnboundSource
URL: https://github.com/apache/beam/pull/37796
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org