Skip to content

Commit

Permalink
Merge pull request #417 from HDFGroup/objid
Browse files Browse the repository at this point in the history
fix comment grammer
  • Loading branch information
mattjala authored Feb 11, 2025
2 parents d08f414 + c64853f commit 4901242
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion hsds/util/hdf5dtype.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ def __init__(self, bind):
self._objref = weakref.ref(bind)

def __repr__(self):
return "<HDF5 object reference>"
# TBD: this is not consistent with hsds or h5py...
if not isinstance(self._id.id, str):
raise TypeError("Expected string id")
item = None

collection_type = self._id.collection_type
item = f"{collection_type}/{self._id.id}"
return item

def tolist(self):
if type(self._id.id) is not str:
Expand Down
4 changes: 2 additions & 2 deletions hsds/util/idUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def createObjId(obj_type, rootid=None):
token = list(hashlib.sha256(salt.encode()).hexdigest())

if rootid:
# replace first 16 chars of token with first 16 chars of rootid
# replace first 16 chars of token with first 16 chars of root id
root_hex = getIdHexChars(rootid)
token[0:16] = root_hex[0:16]
else:
Expand Down Expand Up @@ -184,7 +184,7 @@ def getS3Key(id):
"db/id[0:16]/d/id[16:32]/x_y_z
For domain id's:
Return a key with the .domain suffix and no preceeding slash.
Return a key with the .domain suffix and no preceding slash.
For non-default buckets, use the format: <bucket_name>/s3_key
If the id has a storage specifier ("s3://", "file://", etc.)
include that along with the bucket name. e.g.: "s3://mybucket/a_folder/a_file.h5"
Expand Down

0 comments on commit 4901242

Please sign in to comment.