You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "damccorm (via GitHub)" <gi...@apache.org> on 2023/04/14 15:14:43 UTC

[GitHub] [beam] damccorm commented on a diff in pull request #26279: Add new example never_run tag for precompiled objects

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


##########
playground/infrastructure/verify.py:
##########
@@ -66,7 +72,46 @@ async def _run_and_verify(self, examples: List[Example]):
             examples: beam examples that should be run
         """
 
+
         async def _populate_fields(example: Example):
+            """
+            Populate fields of the example reading them from the backend or from the repository.
+            Args:
+                example: beam example that should be verified
+            """
+            if example.tag.never_run:
+                logging.info("populating example fields from provided files %s", example.filepath)
+                _populate_from_repo(example)
+            else:
+                await _populate_from_runner(example)
+
+        def _populate_from_repo(example: Example):
+            """
+            Populate fields of the example reading them from the repository.
+            Args:
+                example: beam example that should be verified
+            """
+            path = Path(example.filepath)
+            example_folder = path.parent
+
+            log_file_path = example_folder / self.LOGS_FILENAME
+            # Check if the file exists and read its content
+            if log_file_path.exists():

Review Comment:
   If these files don't exist, should we be raising some sort of exception?



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