Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-8814

--no_auth flag is boolean type and is misleading

Details

    • Bug
    • Status: Triage Needed
    • P1
    • Resolution: Fixed
    • 2.14.0, 2.15.0, 2.16.0, 2.17.0
    • 2.18.0
    • sdk-py-harness
    • Python2, Python3
    • Patch, Important

    Description

      Pipeline options defines a no_auth flag that is type=bool. This type is known to be ambiguous because it will expect a value, but anything passed to it will be considered True. For example, passing in "--no_auth=False" would still evaluate to True. We should instead use action="store_true" which only detects whether the flag is passed or not. 

      Furthermore, PipelineOptions.from_dictionary will assume that boolean flags are passed in without values (e.g. passing --no_auth, instead of --no_auth=True). This, combined with type=bool failing without a value, will ensure that it always fails. 

      sdk_worker_main is the only place that uses from_dictionary (aside from tests), and it will crash if no_auth flag is passed. Looking at pipeline_options_test, tests that call from_dictionary will feed in get_all_options, which means it have intended to only be used for serializing/deserializing flag options.

      So from here, to support the no_auth flag:

      • we change no_auth so that it is action="store_true", or
      • we change sdk_worker_main so that it does not use from_dictionary

      Or both.

      Attachments

        Issue Links

          Activity

            People

              wintermelons David Song
              wintermelons David Song
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 168h
                  168h
                  Remaining:
                  Time Spent - 1h 50m Remaining Estimate - 166h 10m
                  166h 10m
                  Logged:
                  Time Spent - 1h 50m Remaining Estimate - 166h 10m
                  1h 50m