diff --git a/hsds/util/hdf5dtype.py b/hsds/util/hdf5dtype.py index 564104e3..3d7d1d2f 100644 --- a/hsds/util/hdf5dtype.py +++ b/hsds/util/hdf5dtype.py @@ -37,7 +37,14 @@ def __init__(self, bind): self._objref = weakref.ref(bind) def __repr__(self): - return "" + # 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: diff --git a/hsds/util/idUtil.py b/hsds/util/idUtil.py index 68639db3..fe21bbb0 100644 --- a/hsds/util/idUtil.py +++ b/hsds/util/idUtil.py @@ -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: @@ -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: /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"