You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/12/14 11:09:37 UTC
[GitHub] [beam] eantyshev commented on a diff in pull request #24402: [Playground] parse url_notebook example tag
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: github-unsubscribe@beam.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org