66import uuid
77from typing import Any , Callable , Dict , List , Optional , Sequence , TypedDict , Union
88
9+ import numpy as np
910import pytest
1011
1112from integration .conftest import CollectionFactory , CollectionFactoryGet , _sanitize_collection_name
6162DATE3 = datetime .datetime .strptime ("2019-06-10" , "%Y-%m-%d" ).replace (tzinfo = datetime .timezone .utc )
6263
6364
64- def get_numpy_vector (input_list : list ) -> Any :
65- try :
66- import numpy as np
67-
68- return np .array (input_list )
69- except ModuleNotFoundError :
70- return input_list
71-
72-
7365def test_insert_with_typed_dict_generic (
7466 collection_factory : CollectionFactory ,
7567 collection_factory_get : CollectionFactoryGet ,
@@ -309,18 +301,18 @@ class TestInsertManyWithTypedDict(TypedDict):
309301 (
310302 [
311303 DataObject (
312- properties = {"name" : "some numpy one" }, vector = get_numpy_vector ([1 , 2 , 3 ])
304+ properties = {"name" : "some numpy one" }, vector = np . array ([1 , 2 , 3 ])
313305 ),
314306 ],
315307 False ,
316308 ),
317309 (
318310 [
319311 DataObject (
320- properties = {"name" : "some numpy one" }, vector = get_numpy_vector ([1 , 2 , 3 ])
312+ properties = {"name" : "some numpy one" }, vector = np . array ([1 , 2 , 3 ])
321313 ),
322314 DataObject (
323- properties = {"name" : "some numpy two" }, vector = get_numpy_vector ([11 , 12 , 13 ])
315+ properties = {"name" : "some numpy two" }, vector = np . array ([11 , 12 , 13 ])
324316 ),
325317 ],
326318 False ,
@@ -329,7 +321,7 @@ class TestInsertManyWithTypedDict(TypedDict):
329321 [
330322 DataObject (
331323 properties = {"name" : "some numpy 2d" },
332- vector = get_numpy_vector ([[1 , 2 , 3 ], [11 , 12 , 13 ]]),
324+ vector = np . array ([[1 , 2 , 3 ], [11 , 12 , 13 ]]),
333325 ),
334326 ],
335327 True ,
0 commit comments