Skip to content

Conversation

@robertwb
Copy link
Contributor

@robertwb robertwb commented Jul 1, 2022


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

See CI.md for more information about GitHub Actions CI.

@robertwb
Copy link
Contributor Author

robertwb commented Jul 1, 2022

R: @damccorm

@codecov
Copy link

codecov bot commented Jul 1, 2022

Codecov Report

Merging #22132 (e77716e) into master (52e1b3f) will increase coverage by 0.04%.
The diff coverage is 83.33%.

@@            Coverage Diff             @@
##           master   #22132      +/-   ##
==========================================
+ Coverage   73.99%   74.03%   +0.04%     
==========================================
  Files         703      703              
  Lines       92936    93649     +713     
==========================================
+ Hits        68769    69337     +568     
- Misses      22901    23046     +145     
  Partials     1266     1266              
Flag Coverage Δ
python 83.53% <83.33%> (-0.05%) ⬇️

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

Impacted Files Coverage Δ
...dks/python/apache_beam/options/pipeline_options.py 94.76% <75.00%> (-0.20%) ⬇️
...apache_beam/runners/dataflow/internal/apiclient.py 77.34% <85.71%> (-0.05%) ⬇️
sdks/python/apache_beam/transforms/core.py 92.57% <0.00%> (ø)
.../python/apache_beam/typehints/trivial_inference.py 96.41% <0.00%> (ø)
...thon/apache_beam/ml/inference/pytorch_inference.py 0.00% <0.00%> (ø)
...hon/apache_beam/runners/worker/bundle_processor.py 93.67% <0.00%> (ø)
...am/examples/inference/pytorch_language_modeling.py 0.00% <0.00%> (ø)
sdks/python/apache_beam/dataframe/frames.py 95.26% <0.00%> (+<0.01%) ⬆️
sdks/python/apache_beam/typehints/schemas.py 94.65% <0.00%> (+0.10%) ⬆️
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 52e1b3f...e77716e. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 2, 2022

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @AnandInguva for label python.

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

if overrides:
_LOGGER.warning("Discarding invalid overrides: %s", overrides)
if retain_unknown_options:
result.update(overrides)
Copy link
Contributor

Choose a reason for hiding this comment

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

Above, we check:

      if (drop_default and parser.get_default(k) == result[k] and
          not isinstance(parser.get_default(k), ValueProvider)):
        del result[k]

Do we need to do something similar here?

If so (or maybe regardless), it might be cleaner to conditionally do something like for k in overrides instead of for k in list(result) above when retain_unkown_options is set. That also keeps any future updates in one place

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 difficulty is that the set of pipeline options is actually the union of what's in result and what's in overrides. Also, we don't necessarily know what the defaults are for values that don't come from flags.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, we don't necessarily know what the defaults are for values that don't come from flags.

I guess my point is, will we ever know what the defaults are? If so, its probably worth keeping?

I still think we could consolidate - even though the set of pipeline options is the union of result and overrides, we're only adding the overrides in the previous loop so I think for k in overrides would be valid in this case.

Regardless, its at most a small code cleanliness win (if that), so I'm good leaving it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, we need to keep things if we don't know (for sure) what the default is.

We can't easily consolidate because as well as things in overrides that don't work for parser.get_default (or at least are not safe to use the guessed default) there may be things already in result that are not in overrides that we want to remove because they have default values.

I agree this code is all very messy. Were I to do it again I would probably try better to detangle the argument parsing code from PipelineOptions.

Copy link
Contributor Author

@robertwb robertwb left a comment

Choose a reason for hiding this comment

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

Thanks for looking at this!

@damccorm
Copy link
Contributor

damccorm commented Jul 7, 2022

Run Python PreCommit

@robertwb robertwb merged commit 20949a9 into apache:master Jul 8, 2022
@TheNeuralBit
Copy link
Member

I suspect that the change to pipeline options here broke Python load tests. First failure is here: https://ci-beam.apache.org/job/beam_LoadTests_Python_ParDo_Dataflow_Streaming/659/

With error log:

06:01:37 usage: pardo_test.py [-h] [--runner RUNNER] [--streaming]
06:01:37                      [--resource_hint RESOURCE_HINTS]
06:01:37                      [--beam_services BEAM_SERVICES]
06:01:37                      [--type_check_strictness {ALL_REQUIRED,DEFAULT_TO_ANY}]
06:01:37                      [--type_check_additional TYPE_CHECK_ADDITIONAL]
06:01:37                      [--no_pipeline_type_check] [--runtime_type_check]
...
06:01:37                      [--iterations ITERATIONS]
06:01:37                      [--number_of_counter_operations NUMBER_OF_COUNTER_OPERATIONS]
06:01:37                      [--number_of_counters=0 NUMBER_OF_COUNTERS=0]
06:01:37 pardo_test.py: error: argument --number_of_counters=0: expected one argument
06:01:37 
06:01:37 > Task :sdks:python:apache_beam:testing:load_tests:run FAILED

I haven't root caused this yet. I'll keep digging myself, but if you have any insight it would be appreciated.

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.

3 participants