-
Notifications
You must be signed in to change notification settings - Fork 73
[SYNPY-1686] Suport Pattern column in data model #1285
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
base: develop
Are you sure you want to change the base?
Conversation
thomasyu888
left a comment
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.
BryanFauble
left a comment
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.
Thanks for this! The changes look good to me.
| if node.format is not None: | ||
| schema["format"] = node.format.value | ||
|
|
||
| if hasattr(node, "pattern") and node.pattern is not None: |
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.
Why if hasattr(node, "pattern")?
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.
in the loop starting on line 5280, assuming the node has the pattern attribute raises an exception when it is not present
@andrewelamb
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.
Could you elaborate @SageGJ ?
In any case, the node here is an instance of the TraversalNode dataclass, and one of its attributes is pattern, so you shouldn't ever have to check that the attribute exists via hasattr, right?
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.
if no pattern is specified for the node then the TraversalNode instance of that node will not have a pattern attribute
Problem:
It is necessary to switch from using validation rules to specify regex validation to specifying the regex pattern in a column of the data model.
Solution:
A new optional column has been added to the data model and the use of the regex validation rule has been deprecated.
Testing:
Tests have been updated as well as testing data.
Testing also uncovered a new bug causing failing tests, tracked here