lostluck commented on code in PR #23990:
URL: https://github.com/apache/beam/pull/23990#discussion_r1015987946


##########
sdks/go/pkg/beam/core/runtime/graphx/translate.go:
##########
@@ -1122,7 +1126,12 @@ const defaultEnvId = "go"
 
 func (m *marshaller) addDefaultEnv() string {
        if _, exists := m.environments[defaultEnvId]; !exists {
-               m.environments[defaultEnvId] = m.opt.Environment
+               env := proto.Clone(m.opt.Environment).(*pipepb.Environment)
+               // Add the pipeline level resource hints here for now.
+               // TODO(https://github.com/apache/beam/issues/23893) move to a 
better place for
+               // scoped hints in next pass, which affect number of 
environments set by Go pipelines.
+               env.ResourceHints = m.opt.PipelineResourceHints.Payloads()

Review Comment:
   It isn't guaranteed to be non-nil, but it is implemented to be valid as a 
zero value. It simply returns an empty map for `Payloads`.
   
   That is, `var Foo Hints` is valid, it's simply an immutable empty value. 
There is a test to ensure that the zero value Hints is safe for all its methods.
   
   One must use `resource.NewHints` to create a new grouping of hints to ensure 
these semantics.



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