-
Notifications
You must be signed in to change notification settings - Fork 26
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
Fds 2333 validate attribute unit tests #1517
Conversation
andrewelamb
commented
Oct 4, 2024
•
edited by jira
bot
Loading
edited by jira
bot
- Fixes FDS-2333
- Adds unit tests for Methods of the ValidateAttribute class
- Cleans up documentation for ValidateAttribute class
@@ -1147,6 +1152,7 @@ def type_validation( | |||
) | |||
if vr_errors: | |||
errors.append(vr_errors) | |||
# It seems impossible to get warnings with type rules |
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.
Should this have any follow-up tech debt ticket?
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 I think so. I wanted to mention it here to see if I misunderstood something first.
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.
@andrewelamb I'm not sure where I'm seeing where it's impossible, could you explain in case I missed something? The default message for all the type rules is error
but for every validation rule a user could specify in their data model to specifically raise warnings
or error
regardless of the default level
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.
@GiaJordan that's doesn't appear to be true. See here.
"Use the type checker by setting the ‘Validation Rules’ to one of the types listed below. No additional specifiers are allowed. "
If you look at the code in the validator above that is confirmed. Unless the val_rule is one of ["num", "str", "int", "float"] you'll just get empty errors and warnigns back.
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.
@andrewelamb that does look like the current behavior, I don't think that's intended though, but that would probably be another discussion. Message level specifications are allowed in the rule definitions in validation_rule_info()
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'll start a jira issue then.
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.
|
||
############## | ||
# get_no_entry | ||
############## |
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.
Instead of grouping by comment like this should this be a new class?
class TestGetNoEntry:
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.
Yeah I'm not sure. Do other egineers have preferences for this?
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.
Great additions to the tests! A few comments, but they're all trivial concerns.
Co-authored-by: BryanFauble <17128019+BryanFauble@users.noreply.github.com>
# Because of the above line: manifest_col = manifest_col.astype(str) | ||
# this column has been turned into a string, it's unclear if any values | ||
# from this column can be anything other than a string, and therefore this | ||
# if statement may not be needed | ||
if not isinstance(list_string, str) and entry_has_value: |
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.
Does anyone know why the isinstance(list_string, str)
check is needed?
|