diff --git a/src/fairchem/core/datasets/base_dataset.py b/src/fairchem/core/datasets/base_dataset.py index a52abbb3b..87d5b5752 100644 --- a/src/fairchem/core/datasets/base_dataset.py +++ b/src/fairchem/core/datasets/base_dataset.py @@ -66,8 +66,6 @@ def __len__(self) -> int: return self.num_samples def metadata_hasattr(self, attr) -> bool: - if self._metadata is None: - return False return attr in self._metadata @cached_property @@ -128,7 +126,7 @@ def __init__( self, dataset: BaseDataset, indices: Sequence[int], - metadata: DatasetMetadata | None = None, + metadata: dict[str, ArrayLike], ) -> None: super().__init__(dataset, indices) self.metadata = metadata @@ -137,7 +135,7 @@ def __init__( self.config = dataset.config @cached_property - def _metadata(self) -> DatasetMetadata: + def _metadata(self) -> dict[str, ArrayLike]: return self.dataset._metadata def get_metadata(self, attr, idx):