olehborysevych commented on code in PR #24993:
URL: https://github.com/apache/beam/pull/24993#discussion_r1069601989


##########
playground/infrastructure/helper.py:
##########
@@ -188,13 +188,20 @@ def get_tag(filepath) -> Optional[Tag]:
         line[len(tag_prefix) :] for line in lines[line_start:line_finish]
     )
     yml = yaml.load(embdedded_yaml_content, Loader=yaml.SafeLoader)
-    return Tag(
-        filepath=filepath,
-        line_start=line_start,
-        line_finish=line_finish,
-        **yml[Config.BEAM_PLAYGROUND],
-    )
 
+    try:
+        return Tag(
+            filepath=str(filepath),
+            line_start=line_start,
+            line_finish=line_finish,
+            **yml[Config.BEAM_PLAYGROUND],
+            )
+    except pydantic.ValidationError as err:
+        if len(err.errors()) > 1:
+            raise
+        if err.errors()[0]["msg"] == "multifile is True but no files defined":
+            logging.warning("incomplete multifile example ignored %s", 
filepath)
+            return None

Review Comment:
   Good catch! Thank you! 



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