AydarZaynutdinov commented on a change in pull request #16344:
URL: https://github.com/apache/beam/pull/16344#discussion_r774928476
##########
File path: playground/infrastructure/helper.py
##########
@@ -284,25 +284,24 @@ def _validate(tag: dict, supported_categories: List[str])
-> bool:
valid = False
categories = tag.get(TagFields.categories)
- if categories is not None:
- if not isinstance(categories, list):
- logging.error(
- "tag's field categories is incorrect: %s \n"
- "categories variable should be list format, but tag contains: %s",
- tag.__str__(),
- str(type(categories)))
- valid = False
- else:
- for category in categories:
- if category not in supported_categories:
- logging.error(
- "tag contains unsupported category: %s \n"
- "If you are sure that %s category should be placed in "
- "Beam Playground, you can add it to the "
- "`playground/categories.yaml` file",
- category,
- category)
- valid = False
+ if not isinstance(categories, list):
+ logging.error(
+ "tag's field categories is incorrect: %s \n"
+ "categories variable should be list format, but tag contains: %s",
Review comment:
Above this part this method contains the code where we check all fields
and their values:
```
value = tag.get(field.default)
if value == "" or value is None:
logging.error(
"tag's value is incorrect: %s\nvalue for %s field can not be empty.",
tag.__str__(),
field.default.__str__())
valid = False
```
So if categories value is empty this part should catch it.
--
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]