Skip to content

Conversation

@liferoad
Copy link
Contributor

@liferoad liferoad commented May 24, 2025

Fixes #35034

./gradlew sdks:java:io:expansion-service:build -x test
python sdks/python/gen_xlang_wrappers.py --cleanup

Test

./gradlew :sdks:java:container:java11:docker

EXPANSION_JARS=sdks/java/io/expansion-service/build/libs/beam-sdks-java-io-expansion-service-2.66.0-SNAPSHOT.jar pytest -v sdks/python/apache_beam/transforms/external_transform_provider_it_test.py::ExternalTransformProviderIT::test_run_generate_sequence_with_rate

Output:

(venv) xqhu@xqhu ~/Dev/beam$ EXPANSION_JARS=sdks/java/io/expansion-service/build/libs/beam-sdks-java-io-expansion-service-2.66.0-SNAPSHOT.jar pytest -v sdks/python/apache_beam/transforms/external_transform_provider_it_test.py::ExternalTransformProviderIT::test_run_generate_sequence_with_rate
========================================================== test session starts ===========================================================
platform linux -- Python 3.9.13, pytest-7.4.4, pluggy-1.5.0 -- /usr/local/google/home/xqhu/Dev/beam/venv/bin/python
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase(PosixPath('/usr/local/google/home/xqhu/Dev/beam/.hypothesis/examples'))
rootdir: /usr/local/google/home/xqhu/Dev/beam/sdks/python
configfile: pytest.ini
plugins: requests-mock-1.12.1, xdist-3.6.1, anyio-4.9.0, timeout-2.3.1, hypothesis-6.131.6
timeout: 600.0s
timeout method: signal
timeout func_only: False
collected 1 item                                                                                                                         

sdks/python/apache_beam/transforms/external_transform_provider_it_test.py::ExternalTransformProviderIT::test_run_generate_sequence_with_rate PASSED [100%]


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.

@codecov
Copy link

codecov bot commented May 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.47%. Comparing base (c507677) to head (916348e).
Report is 35 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #35043      +/-   ##
============================================
- Coverage     56.47%   56.47%   -0.01%     
+ Complexity     3300     3298       -2     
============================================
  Files          1184     1184              
  Lines        181773   181778       +5     
  Branches       3409     3409              
============================================
- Hits         102655   102653       -2     
- Misses        75850    75855       +5     
- Partials       3268     3270       +2     
Flag Coverage Δ
java 70.58% <ø> (-0.02%) ⬇️

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.

@github-actions
Copy link
Contributor

Assigning reviewers:

R: @claudevdm for label python.
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).

"Specifies the rate to generate a given number of elements per a given number of seconds. "
+ "Applicable only to unbounded sequences.")
@Nullable
public abstract Rate getRate();
Copy link
Contributor

Choose a reason for hiding this comment

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

This Rate object already has the fields necessary (elements and seconds) to control elements per period. Can you check if this works?

If it doesn't work, I think we can just remove Rate and introduce them as top-level fields

Copy link
Contributor

Choose a reason for hiding this comment

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

i.e. something like provider.GenerateSequence(start=0, rate={elements: 3, seconds: 1})

I don't remember if "rate" is provided as a dict or a beam.Row()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested. The dict works well. I also added the test test_run_generate_sequence_with_rate.

Copy link
Contributor

Choose a reason for hiding this comment

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

If the current Rate dict works then is there a need for this PR?

I don't think it makes sense to duplicate the API. Maybe we should keep the new rate test though

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The original idea is to create the similar syntax to

public GenerateSequence buildExternal(External.ExternalConfiguration config) {
for #35034. If you think we should just keep rate, I am also fine with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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]: GenerateSequence Python SDK constructor does not support period parameter

2 participants