use the validated array instance in testing numpy dump to array, not the array we would generate

This commit is contained in:
sneakers-the-rat 2024-10-11 00:19:59 -07:00
parent 09a5f51f8d
commit 5268884050
Signed by untrusted user who does not match committer: jonny
GPG key ID: 6DCB96EF1E4D232D
2 changed files with 4 additions and 3 deletions

View file

@ -83,7 +83,7 @@ class DaskInterface(Interface):
def _vectorized_to_model(item: Union[dict, BaseModel]) -> BaseModel:
if not isinstance(item, self.dtype):
return self.dtype(**item)
else:
else: # pragma: no cover
return item
return np.vectorize(_vectorized_to_model)(array)

View file

@ -74,12 +74,13 @@ def test_interface_rematch(interface_cases, tmp_output_dir_func):
)
def test_interface_to_numpy_array(dtype_by_interface):
def test_interface_to_numpy_array(dtype_by_interface_instance):
"""
All interfaces should be able to have the output of their validation stage
coerced to a numpy array with np.array()
"""
_ = np.array(dtype_by_interface.array)
_ = np.array(dtype_by_interface_instance.array)
@pytest.mark.serialization