-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check bool examples, don't crash on nonexistent examples. #58
Check bool examples, don't crash on nonexistent examples. #58
Conversation
position = attribute.lc.data[list(attribute)[0]] | ||
msg = "Empty examples for {} are not allowed".format(attr_type) | ||
raise ValidationError.from_yaml_pos(position, msg) | ||
if is_simple_type and attr_type not in ["boolean", "boolean[]"]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thisthat Any idea why this was originally excluded? To support more boolean values like "yes" instead of "true"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we excluded boolean attributes from having an example because it is not very useful to have true
/false
there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know they are not required to have examples (though before this patch, non-array bools without examples would have crashed the generator). But in case they do have examples (which is allowed), the examples should still be checked for whether they have the right type.
semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py
Outdated
Show resolved
Hide resolved
This is a demo for open-telemetry/build-tools#57. (also needs open-telemetry/build-tools#58)
semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py
Outdated
Show resolved
Hide resolved
…attribute.py Co-authored-by: Mario Jonke <mario.jonke@dynatrace.com>
semantic-conventions/src/opentelemetry/semconv/model/semantic_attribute.py
Outdated
Show resolved
Hide resolved
…attribute.py Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
We don't run into this in the spec yet, but if we ever want to remove some integer examples, we will.