Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-7505] Add side input load test to Python SDK #11136

Merged
merged 3 commits into from Mar 26, 2020

Conversation

kamilwu
Copy link
Contributor

@kamilwu kamilwu commented Mar 16, 2020


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • 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.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 16, 2020

Run Python PreCommit

1 similar comment
@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 16, 2020

Run Python PreCommit

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 16, 2020

R: @ibzib Can I ask you for a review?

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 16, 2020

Also a note: although this PR might look like a rework of the existing side input test, it's better to treat it as a completely different, new test (a lot has changed)

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 16, 2020

A PR with Java's version (very similar to this one): #10949

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 16, 2020

cc: @Ardagan


self.side_input_type = self.pipeline.get_option('side_input_type')
if self.side_input_type is None:
raise ValueError('side_input_type is required')
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be helpful to list the types here, too.

for i, _ in enumerate(side_input):
if self._first_n and i >= self._first_n:
return
# No-op. We only make sure that the element is accessed.
Copy link
Contributor

Choose a reason for hiding this comment

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

For first_n < len(side_input), wouldn't we access a total of first_n + 1 elements?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohh that's right. Thanks.
I'll use a while loop and iter(), so that we'd be able to treat list and iterable in the same way.

current Unix seconds-since-epoch timestamp."""
def setup(self):
import time
self.current_time = int(time.time())
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any particular reason we need to use the real time? If not, it would be easier to read timestamps if we start at 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No particular reason. I'll change it to start at 0.

* list available types if `side_input_type` is None
* don't check if `self._first_n` is not None (will always be not None)
* use while loop for iterating over a sequence
* assign timestamps starting from 0
Copy link
Contributor

@ibzib ibzib left a comment

Choose a reason for hiding this comment

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

LGTM (though maybe we should wait on feedback for #10949 before merging)

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 23, 2020

Thanks! I agree, let's wait on that feedback. If everything is ok, I'll merge it.

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 26, 2020

Retest this please

@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 26, 2020

Run Python PreCommit

@kamilwu kamilwu merged commit 789d2ee into apache:master Mar 26, 2020
@kamilwu kamilwu deleted the side-input-tests branch March 26, 2020 10:34
@kamilwu
Copy link
Contributor Author

kamilwu commented Mar 26, 2020

Thanks @ibzib!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants