Skip to content

Commit

Permalink
Merge pull request #306 from 4dn-dcic/possible-sid-indexing-error-fix…
Browse files Browse the repository at this point in the history
…-20241102

possible fix for sid indexing problem
  • Loading branch information
dmichaels-harvard authored Nov 7, 2024
2 parents 6f98e47 + c6ee163 commit b51a8e1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ snovault
Change Log
----------

11.23.0
=======
* 2024-11-02/dmichaels
- Fix for unexpected 'sid' indexing problem.


11.22.0
=======
* 2024-09-03/dmichaels
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicsnovault"
version = "11.22.0"
version = "11.23.0"
description = "Storage support for 4DN Data Portals."
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down
12 changes: 10 additions & 2 deletions snovault/storage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import boto3
from copy import deepcopy
import structlog
import uuid

Expand Down Expand Up @@ -566,8 +567,15 @@ def revision_history(self, *, rid):
session = self.DBSession
revisions = []
for revision in session.query(PropertySheet).filter_by(rid=rid).order_by(PropertySheet.sid):
revision.properties['sid'] = revision.sid
revisions.append(revision.properties)
# 2024-11-04/C4-1188/PR-306/dmichaels:
# Fix for "sid" appearing in properties in some situations, and ultimately ending up
# with validation-errors = Additional properties are not allowed ('sid' was unexpected).
# See smaht-portal/.../test_types_file.py for 92e8371b-bcdf-44de-ad49-3a5f108e91eb (from workbook-inserts).
# revision.properties['sid'] = revision.sid
# revisions.append(revision.properties)
revision_properties = deepcopy(revision.properties)
revision_properties['sid'] = revision.sid
revisions.append(revision_properties)
return revisions


Expand Down

0 comments on commit b51a8e1

Please sign in to comment.