Do nothing on put_scalar(None)

This commit is contained in:
2021-07-27 10:55:19 -05:00
parent 6c98986675
commit f1dc450cbf
2 changed files with 9 additions and 0 deletions

View File

@@ -132,6 +132,8 @@ class MemorySample(Sample):
@overrides
def put_scalar(self, key: str, value: Scalar) -> None:
if value is None:
return
self._assert_is_scalar(value)
self._put(key, value)
@@ -220,6 +222,8 @@ class Hdf5Sample(Sample):
@overrides
def put_scalar(self, key: str, value: Any) -> None:
if value is None:
return
self._assert_is_scalar(value)
self._put(key, value)