Skip to content

Commit

Permalink
Fix logic bug in _getStorageClass and add support for str type
Browse files Browse the repository at this point in the history
  • Loading branch information
mfisherlevine committed Mar 15, 2024
1 parent 511d1ef commit 00859ee
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/lsst/pipe/base/_dataset_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
self,
inMemoryDataset: Any,
*,
storageClass: StorageClass | None = None,
storageClass: StorageClass | str | None = None,
parameters: dict[str, Any] | None = None,
dataId: DataId | None = None,
copy: bool = False,
Expand Down Expand Up @@ -252,7 +252,10 @@ def _getStorageClass(self) -> StorageClass:
"""
factory = StorageClassFactory()
if self.storageClass:
return factory.getStorageClass(self.storageClass)
if isinstance(self.storageClass, str):
return factory.getStorageClass(self.storageClass)
else:
return self.storageClass

# Need to match python type.
pytype = type(self.inMemoryDataset)
Expand Down

0 comments on commit 00859ee

Please sign in to comment.