damccorm commented on code in PR #24402:
URL: https://github.com/apache/beam/pull/24402#discussion_r1047541679


##########
playground/infrastructure/helper.py:
##########
@@ -273,33 +276,38 @@ def get_supported_categories(categories_path: str) -> 
List[str]:
         yaml_object = yaml.load(supported_categories.read(), 
Loader=yaml.SafeLoader)
         return yaml_object[TagFields.categories]
 
+def _get_url_vcs(filepath: str):
+    """
+    Construct VCS URL from example's filepath
+    """
+    root_dir = os.getenv("BEAM_ROOT_DIR", "")
+    file_path_without_root = filepath.replace(root_dir, "", 1)
+    if file_path_without_root.startswith("/"):
+        return "{}{}".format(Config.URL_VCS_PREFIX, file_path_without_root)
+    else:
+        return "{}/{}".format(Config.URL_VCS_PREFIX, file_path_without_root)

Review Comment:
   I know this is a lift and shift, but should we just use `filepath.Join`? 
https://pkg.go.dev/path#Join
   
   I think the if else could be condensed to `return 
filepath.Join(Config.URL_VCS_PREFIX, file_path_without_root)`



##########
playground/infrastructure/datastore_client.py:
##########
@@ -271,10 +270,12 @@ def _to_example_entity(self,
                 "descr": example.tag.description,
                 "tags": example.tag.tags,
                 "cats": example.tag.categories,
-                "path": example.link,

Review Comment:
   Is there an issue tracking its removal? If not, could we add one?



##########
playground/infrastructure/helper.py:
##########
@@ -37,6 +37,7 @@
 from config import Config, Origin, TagFields, PrecompiledExampleType, 
OptionalTagFields
 from grpc_client import GRPCClient
 
+# TODO replace with dataclass

Review Comment:
   Same question as above - could we add an issue for this (or drop a link in 
this comment if one already exists)?



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