[
https://issues.apache.org/jira/browse/BEAM-13790?focusedWorklogId=719366&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-719366
]
ASF GitHub Bot logged work on BEAM-13790:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 02/Feb/22 13:29
Start Date: 02/Feb/22 13:29
Worklog Time Spent: 10m
Work Description: ilya-kozyrev commented on a change in pull request
#16700:
URL: https://github.com/apache/beam/pull/16700#discussion_r797605462
##########
File path: playground/backend/internal/cloud_bucket/precompiled_objects.go
##########
@@ -164,6 +180,10 @@ func (cd *CloudStorage) GetPrecompiledObjects(ctx
context.Context, targetSdk pb.
logger.Errorf("json.Unmarshal: %v", err.Error())
continue
}
+
+ folderName := strings.Split(objectDir,
string(os.PathSeparator))[1]
+ precompiledObject.Type = getObjectTypeByFolderName(folderName)
Review comment:
```suggestion
precompiledObject.Type =
pb.PrecompiledObjectType(pb.PrecompiledObjectType_value[folderName])
```
##########
File path: playground/backend/internal/cloud_bucket/precompiled_objects.go
##########
@@ -266,6 +286,20 @@ func getFileExtensionBySdk(precompiledObjectPath string)
(string, error) {
return extension, nil
}
+// getObjectTypeByFolderName returns pb.PrecompiledObjectType by folder name
+func getObjectTypeByFolderName(folderName string) pb.PrecompiledObjectType {
+ switch folderName {
+ case "PRECOMPILED_OBJECT_TYPE_EXAMPLE":
+ return pb.PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_EXAMPLE
+ case "PRECOMPILED_OBJECT_TYPE_KATA":
+ return pb.PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_KATA
+ case "PRECOMPILED_OBJECT_TYPE_UNIT_TEST":
+ return
pb.PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_UNIT_TEST
+ default:
+ return
pb.PrecompiledObjectType_PRECOMPILED_OBJECT_TYPE_UNSPECIFIED
+ }
+}
+
Review comment:
This function redundant
```suggestion
```
--
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]
Issue Time Tracking
-------------------
Worklog Id: (was: 719366)
Time Spent: 0.5h (was: 20m)
> [Playground] Change logic of receiving examples from the bucket on backend
> side
> -------------------------------------------------------------------------------
>
> Key: BEAM-13790
> URL: https://issues.apache.org/jira/browse/BEAM-13790
> Project: Beam
> Issue Type: Sub-task
> Components: beam-playground
> Reporter: Aydar Zaynutdinov
> Assignee: Aydar Zaynutdinov
> Priority: P3
> Labels: beam-playground-backend, beam-playground-sprint-8
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Need to change the logic of receiving examples from the bucket by a new
> architecture
--
This message was sent by Atlassian Jira
(v8.20.1#820001)