Skip to content

Conversation

@SageGJ
Copy link
Contributor

@SageGJ SageGJ commented Nov 26, 2025

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

@SageGJ SageGJ marked this pull request as ready for review November 26, 2025 20:57
@SageGJ SageGJ requested a review from a team as a code owner November 26, 2025 20:57
@thomasyu888 thomasyu888 changed the title Synpy 1686 [SYNPY-1686] Suport Pattern column in data model Nov 26, 2025
Copy link
Member

@thomasyu888 thomasyu888 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Awesome to see this. @SageGJ I updated the PR title - do adjust as you see fit.

I'll defer to the @linglp for a final review of this.

Copy link
Member

@BryanFauble BryanFauble left a 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:
Copy link
Contributor

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")?

Copy link
Contributor Author

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

Copy link
Contributor

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?

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants