-
Notifications
You must be signed in to change notification settings - Fork 28
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
model.base: Remove occurrences of deprecated constraint AASd-100 #121
Conversation
@jkhsjdhjs Can you review this? |
:param unit: unit of the data object (optional) | ||
:raises ValueError: if the constraint is not fulfilled | ||
""" | ||
if unit == "": | ||
raise ValueError("unit is not allowed to be an empty string") |
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 should keep these ValueErrors
as we otherwise have an ambiguity with None
and an empty string.
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.
This issue will be solved automatically, when implementing AASd-130 (#118) :
Constraint AASd-130: An attribute with data type "string" shall consist of these
characters only: ^[\x09\x0A\x0D\x20-\uD7FF\uE000-\uFFFD\u00010000-
\u0010FFFF]*$.
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.
How? As far as I can tell this regex allows the empty string.
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.
Right, but in combination with the constrained string type regex, it should not be allowed. (Otherwise that's another finding)
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.
Yes, but unit
, sourceOfDefinition
and symbol
are not of any constrained string type, but simply of type string
.
But I also just noticed that while Constraint AASd-100 seens to have been removed from the DataSpecification classes, it is still part of Part1, where it doesn't make any sense anymore, since Part1 doesn't contain any attributes of type string
. But assuming it still applies to Part3a, should this be left as is or simply changed to an AASConstraintViolation(100, ...)
instead of a ValueError()
?
Version 3.0 of the specification removes AASd-100: