[ 
https://issues.apache.org/jira/browse/BEAM-11519?focusedWorklogId=540425&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-540425
 ]

ASF GitHub Bot logged work on BEAM-11519:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Jan/21 01:19
            Start Date: 23/Jan/21 01:19
    Worklog Time Spent: 10m 
      Work Description: ihji commented on a change in pull request #13606:
URL: https://github.com/apache/beam/pull/13606#discussion_r562994955



##########
File path: sdks/go/pkg/beam/artifact/materialize.go
##########
@@ -69,41 +74,100 @@ func newMaterialize(ctx context.Context, endpoint string, 
dependencies []*pipepb
        return newMaterializeWithClient(ctx, 
jobpb.NewArtifactRetrievalServiceClient(cc), dependencies, dest)
 }
 
-func newMaterializeWithClient(ctx context.Context, client 
jobpb.ArtifactRetrievalServiceClient, dependencies 
[]*pipepb.ArtifactInformation, dest string) ([]*jobpb.ArtifactMetadata, error) {
+func newMaterializeWithClient(ctx context.Context, client 
jobpb.ArtifactRetrievalServiceClient, dependencies 
[]*pipepb.ArtifactInformation, dest string) ([]*pipepb.ArtifactInformation, 
error) {
        resolution, err := client.ResolveArtifacts(ctx, 
&jobpb.ResolveArtifactsRequest{Artifacts: dependencies})
        if err != nil {
                return nil, err
        }
 
-       var md []*jobpb.ArtifactMetadata
+       var artifacts []*pipepb.ArtifactInformation
        var list []retrievable
        for _, dep := range resolution.Replacements {
                path, err := extractStagingToPath(dep)
                if err != nil {
                        return nil, err
                }
-               md = append(md, &jobpb.ArtifactMetadata{
-                       Name: path,
+               var filePayload pipepb.ArtifactFilePayload
+               if dep.TypeUrn != URNFileArtifact {
+                       filePayload = pipepb.ArtifactFilePayload{
+                               Path: path,
+                       }
+               } else {
+                       typePayload := pipepb.ArtifactFilePayload{}
+                       if err := proto.Unmarshal(dep.TypePayload, 
&typePayload); err != nil {
+                               return nil, errors.Wrap(err, "failed to parse 
artifact file payload")
+                       }
+                       filePayload = pipepb.ArtifactFilePayload{
+                               Path:   path,
+                               Sha256: typePayload.Sha256,
+                       }
+               }

Review comment:
       Done. Thanks for the readability review.




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

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 540425)
    Time Spent: 5h 50m  (was: 5h 40m)

> Adding PYPI_INSTALL_REQ role and SDK container support
> ------------------------------------------------------
>
>                 Key: BEAM-11519
>                 URL: https://issues.apache.org/jira/browse/BEAM-11519
>             Project: Beam
>          Issue Type: Sub-task
>          Components: beam-model, cross-language, sdk-py-harness
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: P2
>          Time Spent: 5h 50m
>  Remaining Estimate: 0h
>
> Adding PYPI_INSTALL_REQ role and SDK container support



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to