mirror of
https://github.com/p2p-ld/numpydantic.git
synced 2024-11-12 17:54:29 +00:00
use the validated array instance in testing numpy dump to array, not the array we would generate
This commit is contained in:
parent
09a5f51f8d
commit
5268884050
2 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue