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


##########
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:
   The result here is not a file system path, but URL, though I brushed it up a 
bit



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