Skip to content

Commit 0b18b98

Browse files
authored
Merge pull request #1639 from Sage-Bionetworks/v25.8.1-rc-dev
Release `v25.8.1`
2 parents 6fe0b99 + 0a6365e commit 0b18b98

File tree

5 files changed

+36
-28
lines changed

5 files changed

+36
-28
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "schematicpy"
3-
version = "25.7.1"
3+
version = "25.8.1"
44
description = "Package for biomedical data model and metadata ingress management"
55
authors = [
66
"Milen Nikolov <milen.nikolov@sagebase.org>",

schematic/schemas/create_json_schema.py

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -281,30 +281,28 @@ def _get_validation_rule_based_fields(
281281
# Schematic will use the implicit type if the explicit type isn't specified for now,
282282
# but this behavior is deprecated and will be removed in the future by SCHEMATIC-326
283283
implicit_js_type = get_js_type_from_inputted_rules(validation_rules)
284-
# If there is an explicit type set...
285-
if explicit_js_type:
286-
# and the implicit type conflicts with the explicit type, then an exception is raised
287-
if explicit_js_type != implicit_js_type:
288-
msg = (
289-
f"Property: '{name}', has explicit type: '{explicit_js_type}' "
290-
f"that conflicts with the implicit type: '{implicit_js_type}' "
291-
f"derived from its validation rules: {validation_rules}"
292-
)
293-
raise ValueError(msg)
294-
# If there is no explicit type...
295-
else:
296-
# and there is an implicit type...
297-
if implicit_js_type:
298-
# then the implicit type is used...
299-
js_type = implicit_js_type
300-
# and a warning is raised since this behavior is deprecated
301-
msg = (
302-
f"No explicit type set for property: '{name}', "
303-
"using validation rules to set the type. "
304-
"Using validation rules to set type is deprecated. "
305-
"You should set the columnType for this property in your data model."
306-
)
307-
warnings.warn(msg)
284+
# If there is an explicit and implicit type set and the implicit type conflicts with the
285+
# explicit type, then an exception is raised
286+
if (
287+
explicit_js_type
288+
and implicit_js_type
289+
and explicit_js_type != implicit_js_type
290+
):
291+
msg = (
292+
f"Property: '{name}', has explicit type: '{explicit_js_type}' "
293+
f"that conflicts with the implicit type: '{implicit_js_type}' "
294+
f"derived from its validation rules: {validation_rules}"
295+
)
296+
raise ValueError(msg)
297+
if implicit_js_type:
298+
js_type = implicit_js_type
299+
msg = (
300+
f"No explicit type set for property: '{name}', "
301+
"using validation rules to set the type. "
302+
"Using validation rules to set type is deprecated. "
303+
"You should set the columnType for this property in your data model."
304+
)
305+
warnings.warn(msg)
308306

309307
if ValidationRuleName.URL in validation_rule_names:
310308
js_format = JSONSchemaFormat.URI

schematic/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Sets the version of the package"""
22
# Version hardcoded see https://sagebionetworks.jira.com/browse/SCHEMATIC-229
3-
__version__ = "25.7.1"
3+
__version__ = "25.8.1"

schematic_api/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ LABEL version=$TAG
3737

3838
# run open ssl and generate certificate
3939
RUN apt update && \
40-
apt-get install openssl && \
40+
apt-get install -y openssl && \
4141
openssl req -x509 -nodes -days 365 \
4242
-subj "/C=CA/ST=QC/O=Company" \
4343
-newkey rsa:2048 -keyout /etc/ssl/private/localhost.key \

tests/unit/test_create_json_schema.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,16 @@ def test_get_validation_rule_based_fields_no_explicit_type(
283283
None,
284284
None,
285285
),
286+
(
287+
["list"],
288+
JSONSchemaType.STRING,
289+
JSONSchemaType.STRING,
290+
True,
291+
None,
292+
None,
293+
None,
294+
None,
295+
),
286296
(
287297
["inRange 50 100"],
288298
JSONSchemaType.NUMBER,
@@ -324,7 +334,7 @@ def test_get_validation_rule_based_fields_no_explicit_type(
324334
JSONSchemaFormat.URI,
325335
),
326336
],
327-
ids=["No rules", "String", "InRange", "Regex", "Date", "URL"],
337+
ids=["No rules", "String", "List string", "InRange", "Regex", "Date", "URL"],
328338
)
329339
def test_get_validation_rule_based_fields_with_explicit_type(
330340
validation_rules: list[str],

0 commit comments

Comments
 (0)