Skip to content

Commit 24f800e

Browse files
committed
Merge branch 'master' into devendorize
# Conflicts: # dandischema/tests/test_models.py
2 parents 5406628 + c36c7c6 commit 24f800e

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

dandischema/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1904,6 +1904,11 @@ class PublishedDandiset(Dandiset, Publishable):
19041904
description="Permalink to the Dandiset.",
19051905
json_schema_extra={"readOnly": True, "nskey": "schema"},
19061906
)
1907+
releaseNotes: Optional[str] = Field(
1908+
None,
1909+
description="The description of the release",
1910+
json_schema_extra={"readOnly": True, "nskey": "schema"},
1911+
)
19071912

19081913
schemaKey: Literal["Dandiset"] = Field(
19091914
"Dandiset", validate_default=True, json_schema_extra={"readOnly": True}

dandischema/tests/test_models.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def test_dandimeta_1() -> None:
374374

375375
assert DOI_PREFIX is not None
376376

377-
# meta data without doi, datePublished and publishedBy
377+
# metadata without doi, datePublished and publishedBy
378378
meta_dict: Dict[str, Any] = {
379379
"identifier": f"{INSTANCE_NAME}:999999",
380380
"id": f"{INSTANCE_NAME}:999999/draft",
@@ -463,7 +463,20 @@ def test_dandimeta_1() -> None:
463463
basic_publishmeta(INSTANCE_NAME, dandi_id="999999", prefix=DOI_PREFIX)
464464
)
465465
meta_dict["assetsSummary"].update(**{"numberOfBytes": 1, "numberOfFiles": 1})
466-
PublishedDandiset(**meta_dict)
466+
467+
# Test that releaseNotes is optional (can be omitted)
468+
dandiset_without_notes = PublishedDandiset(**meta_dict)
469+
assert dandiset_without_notes.releaseNotes is None
470+
471+
# Test that releaseNotes can be set to a string value
472+
meta_dict["releaseNotes"] = "Releasing during testing"
473+
dandiset_with_notes = PublishedDandiset(**meta_dict)
474+
assert dandiset_with_notes.releaseNotes == "Releasing during testing"
475+
476+
# Test that releaseNotes appears in model_dump
477+
dumped = dandiset_with_notes.model_dump(exclude_none=True)
478+
assert "releaseNotes" in dumped
479+
assert dumped["releaseNotes"] == "Releasing during testing"
467480

468481

469482
def test_schemakey() -> None:

0 commit comments

Comments
 (0)