damccorm commented on a change in pull request #16719:
URL: https://github.com/apache/beam/pull/16719#discussion_r799012784



##########
File path: sdks/go/pkg/beam/runners/direct/direct.go
##########
@@ -65,6 +65,7 @@ func Execute(ctx context.Context, p *beam.Pipeline) 
(beam.PipelineResult, error)
        if err != nil {
                return nil, errors.Wrap(err, "translation failed")
        }
+       beam.PipelineOptions.LoadOptionsFromFlags(make(map[string]bool))

Review comment:
       Oh nice - that's much cleaner, thanks for calling that option out! 
Updated!

##########
File path: sdks/go/pkg/beam/core/runtime/options.go
##########
@@ -117,6 +118,23 @@ func (o *Options) Export() RawOptions {
        return RawOptions{Options: copyMap(o.opt)}
 }
 
+// LoadOptionsFromFlags adds any flags not defined in excludeFlags to the 
options.
+// If the key is already defnined, it panics.

Review comment:
       As I think about this more, I actually think this is probably not the 
behavior we want anyways. If a pipeline author tries to write to 
PipelineOptions with a value that also happens to be a flag, I think we want to 
let them do that - we shouldn't steamroll their value. I've updated to just 
ignore any keys that are already defined.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to