Skip to content
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

Remove escaping (\) of : in 2 identifiers regexes #290

Merged
merged 3 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dandischema/consts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DANDI_SCHEMA_VERSION = "0.6.9"
DANDI_SCHEMA_VERSION = "0.6.10"
ALLOWED_INPUT_SCHEMAS = [
"0.4.4",
"0.5.1",
Expand All @@ -12,6 +12,7 @@
"0.6.6",
"0.6.7",
"0.6.8",
"0.6.9",
DANDI_SCHEMA_VERSION,
]

Expand Down
4 changes: 2 additions & 2 deletions dandischema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,7 @@ class Person(Contributor):
class Software(DandiBaseModel):
identifier: Optional[RRID] = Field(
None,
pattern=r"^RRID\:.*",
pattern=r"^RRID:.*",
title="Research resource identifier",
description="RRID of the software from scicrunch.org.",
json_schema_extra={"nskey": "schema"},
Expand Down Expand Up @@ -1612,7 +1612,7 @@ def contributor_musthave_contact(
identifier: DANDI = Field(
title="Dandiset identifier",
description="A Dandiset identifier that can be resolved by identifiers.org.",
pattern=r"^DANDI\:\d{6}$",
pattern=r"^DANDI:\d{6}$",
json_schema_extra={"readOnly": True, "nskey": "schema"},
)
name: str = Field(
Expand Down
9 changes: 8 additions & 1 deletion dandischema/tests/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,14 @@
]

# if already the target version - we do not change it, and do not crash
newmeta_2 = migrate(newmeta, to_version=DANDI_SCHEMA_VERSION)
newmeta_2 = migrate(

Check warning on line 432 in dandischema/tests/test_metadata.py

View check run for this annotation

Codecov / codecov/patch

dandischema/tests/test_metadata.py#L432

Added line #L432 was not covered by tests
newmeta,
to_version=DANDI_SCHEMA_VERSION,
# to avoid possible crash due to attempt to download not yet
# released schema if we are still working within yet to be
# released version of the schema
skip_validation=True,
)
assert newmeta_2 == newmeta
assert newmeta_2 is not newmeta # but we do create a copy

Expand Down
Loading