Skip to content

Commit e7ffba2

Browse files
committed
cleaned up if statement logic
1 parent e042ee7 commit e7ffba2

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

synapseclient/extensions/curator/schema_generation.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4494,6 +4494,10 @@ def _get_validation_rule_based_fields(
44944494
)
44954495
logger.warning(msg)
44964496

4497+
# url and date rules are deprecated for adding format keyword
4498+
# TODO: remove the if/else block below
4499+
# https://sagebionetworks.jira.com/browse/SYNPY-1685
4500+
44974501
if explicit_format:
44984502
if (
44994503
ValidationRuleName.DATE in validation_rule_names
@@ -4516,10 +4520,6 @@ def _get_validation_rule_based_fields(
45164520
)
45174521
logger.warning(msg)
45184522

4519-
# url and date rules are deprecated for adding format keyword
4520-
# TODO: remove the if/else block below
4521-
# https://sagebionetworks.jira.com/browse/SYNPY-1685
4522-
45234523
else:
45244524
if ValidationRuleName.URL in validation_rule_names:
45254525
js_format = JSONSchemaFormat.URI
@@ -4650,10 +4650,7 @@ def __post_init__(self) -> None:
46504650
# https://sagebionetworks.jira.com/browse/SYNPY-1685
46514651
explicit_format = self.dmge.get_node_format(node_display_name=self.display_name)
46524652
if explicit_format:
4653-
if (
4654-
column_type != ListColumnType.STRING_LIST
4655-
and column_type != AtomicColumnType.STRING
4656-
):
4653+
if column_type not in (ListColumnType.STRING_LIST, AtomicColumnType.STRING):
46574654
msg = (
46584655
f"A format value (current value: {explicit_format.value}) "
46594656
f"is set for property: {self.name}, but columnType is not a string type "

0 commit comments

Comments
 (0)