Skip to content

Conversation

@andrewelamb
Copy link
Contributor

@andrewelamb andrewelamb commented Nov 14, 2025

SYNPY-1679

Problem:

When creating JSON Schemas, Schematic/Curator extension was relying on the presence of URL and Date validation rules to know when to add the format keyword.

Solution:

The format column was added to data model CSVs. This allows users to set the format keyword explicitly.

@andrewelamb andrewelamb requested a review from a team as a code owner November 14, 2025 19:53
@andrewelamb andrewelamb marked this pull request as draft November 14, 2025 19:53
@andrewelamb andrewelamb changed the title Synpy 1679 [SYNPY-1679] Add format column to csv data model. Nov 18, 2025
@andrewelamb andrewelamb marked this pull request as ready for review November 18, 2025 16:28
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.

🔥 I took a look at this, and the overall logic looks sound. I'll defer to the team for a final review.

@andrewelamb andrewelamb requested a review from a team November 19, 2025 18:24
@thomasyu888 thomasyu888 requested a review from linglp November 19, 2025 18:32
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.

These look good to me. Thanks for the changes!

@andrewelamb andrewelamb merged commit a557de9 into develop Nov 20, 2025
79 of 94 checks passed
@andrewelamb andrewelamb deleted the SYNPY-1679 branch November 20, 2025 16:37
# TODO: set self.format here instead of passing it to get_validation_rule_based_fields
# https://sagebionetworks.jira.com/browse/SYNPY-1685
explicit_format = self.dmge.get_node_format(node_display_name=self.display_name)
if explicit_format:
Copy link
Contributor

@linglp linglp Nov 20, 2025

Choose a reason for hiding this comment

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

Do you have tests that cover this part? The tests verify that format is set correctly when columnType is a string type, but there's no test that verifies a ValueError is raised when columnType is NOT a string type

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I also think this part can be in a separate function to improve testability

if format_value is None:
return format_value
format_string = str(format_value).lower()
try:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this try-except block is also not tested in test_get_node_format

Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I am also wondering whether this part could be changed to call check_allowed_values directly, given that its purpose is to verify whether the values are allowed.

@andrewelamb
Copy link
Contributor Author

@linglp Looks like I was a little quick merging this into develop. I'll create a separate PR for your suggestions when I'm back after Thanksgiving.

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.

5 participants