Skip to content

Commit

Permalink
Fix dicts in RemoteButler data IDs
Browse files Browse the repository at this point in the history
Fixed an issue where UnboundLocalError would be thrown when passing a
dict as a DataId to a RemoteButler function
  • Loading branch information
dhirving committed Nov 29, 2023
1 parent 59fff8c commit 0cc0120
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions python/lsst/daf/butler/remote_butler/_remote_butler.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,9 @@ def _simplify_dataId(
if isinstance(dataId, DataCoordinate):
return dataId.to_simple()

if dataId is None:
data_id = kwargs
elif kwargs:
# Change variable because DataId is immutable and mypy complains.
data_id = dict(dataId)
data_id.update(kwargs)

# Assume we can treat it as a dict.
data_id = dict(dataId) if dataId is not None else {}
data_id.update(kwargs)
return SerializedDataCoordinate(dataId=data_id)

def _caching_context(self) -> AbstractContextManager[None]:
Expand Down

0 comments on commit 0cc0120

Please sign in to comment.