Skip to content

Commit

Permalink
Use Mapping instead of dict to fix downsteam type complaints.
Browse files Browse the repository at this point in the history
With this change, downstream code can list just what types they might
actually provide, rather than all of the ones the method could accept.
  • Loading branch information
TallJimbo committed Feb 24, 2025
1 parent c069fb2 commit a913b63
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/lsst/daf/butler/_dataset_provenance.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ def add_input(self, ref: DatasetRef) -> None:
self._uuids.add(ref.id)
self.inputs.append(ref.to_simple())

def add_extra_provenance(self, dataset_id: uuid.UUID, extra: dict[str, _PROV_TYPES]) -> None:
def add_extra_provenance(self, dataset_id: uuid.UUID, extra: Mapping[str, _PROV_TYPES]) -> None:
"""Attach extra provenance to a specific dataset.
Parameters
----------
dataset_id : `uuid.UUID`
The ID of the dataset to receive this provenance.
extra : `dict` [ `str`, `typing.Any` ]
extra : `~collections.abc.Mapping` [ `str`, `typing.Any` ]
The extra provenance information as a dictionary. The values
must be simple Python scalars or scalars that can be serialized
by Pydantic and convert to a simple string value.
Expand Down

0 comments on commit a913b63

Please sign in to comment.