-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-8224] Fix bug in _fn_takes_side_inputs #9563
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
Conversation
Bug was introduced in the conversion to inspect.signature, and manifests as assigning a wrapper function that accepts a single positional argument when the wrapped function can accept an arbitrary number.
|
R: @robertwb |
|
run pytthon 2 postcommit |
|
run python 2 postcommit |
|
run python 3.7 postcommit |
|
Changes LGTM. Py2 tests are failing due to: https://issues.apache.org/jira/browse/BEAM-8229 |
|
Run Python 3.7 PostCommit |
1 similar comment
|
Run Python 3.7 PostCommit |
robertwb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should fix it, just one comment about tests.
| # Test that a lambda that accepts only a VAR_POSITIONAL can accept | ||
| # side-inputs. | ||
| result = (['a', 'b', 'c'] | ||
| | beam.Map(lambda *_: 'a', 5).with_input_types(str, int)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's check that it actually gets the values right, e.g. do lambda *args: args. (Similarly below.)
|
#9570 is merge which should unblock Python2_PC failure. |
|
Run Python 3.7 PostCommit |
|
Run Portable_Python PreCommit |
|
New tests are failing in the precommit tests: 17:59:06 ====================================================================== |
|
Run Python PreCommit |
|
trivial_inference.py defaults to Any in 3.6, 3.7 since it doesn't support kwargs (added by the wrapper). Even if we did pass side-input hints, there is still missing logic that would bind the arguments for the var_positional into a single tuple (like getcallargs or signature.bind). Perhaps we should skip trivial_inference when side-inputs are present. |
Would we need to skip it for all python version or for some python versions? I am in favor of skipping in order to not block the release and continue with the proper fix in master. /cc @tvalentyn in case anything needs to be documented as known issues for python 3. |
Worked around an issue with trivial_inference not being passed side-input hints.
|
Run Portable_Python PreCommit |
1 similar comment
|
Run Portable_Python PreCommit |
|
I've opened a couple of bug for the portable precommit flakes: |
|
I believe we can safely ignore the portable python precommit failure, since this PR is holding up the release. |
Bug was introduced in the conversion to inspect.signature, and manifests as assigning a wrapper function that accepts a single positional argument when the wrapped function can accept an arbitrary number.
Bug was introduced in the conversion to inspect.signature, and manifests as assigning a wrapper function that accepts a single positional argument when the wrapped function can accept an arbitrary number.
Bug was introduced in the conversion to inspect.signature, and manifests
as assigning a wrapper function that accepts a single positional
argument when the wrapped function can accept an arbitrary number.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.