File tree Expand file tree Collapse file tree
weaviate/collections/classes Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,17 @@ def test_empty_input_contains_any() -> None:
2121 wvc .query .Filter .by_id ().contains_any ([])
2222 with pytest .raises (weaviate .exceptions .WeaviateInvalidInputError ):
2323 wvc .query .Filter .by_property ("test" ).contains_any ([])
24+ with pytest .raises (weaviate .exceptions .WeaviateInvalidInputError ):
25+ wvc .query .Filter .by_creation_time ().contains_any ([])
26+ with pytest .raises (weaviate .exceptions .WeaviateInvalidInputError ):
27+ wvc .query .Filter .by_update_time ().contains_any ([])
28+
29+
30+ def test_empty_input_contains_none_time () -> None :
31+ with pytest .raises (weaviate .exceptions .WeaviateInvalidInputError ):
32+ wvc .query .Filter .by_creation_time ().contains_none ([])
33+ with pytest .raises (weaviate .exceptions .WeaviateInvalidInputError ):
34+ wvc .query .Filter .by_update_time ().contains_none ([])
2435
2536
2637def test_empty_input_contains_all () -> None :
Original file line number Diff line number Diff line change @@ -320,6 +320,8 @@ def contains_any(self, dates: List[datetime]) -> _Filters:
320320 Args:
321321 dates: List of dates to filter on.
322322 """
323+ if len (dates ) == 0 :
324+ raise WeaviateInvalidInputError ("Filter contains_any must have at least one value" )
323325 return _FilterValue (
324326 target = self ._target_path (),
325327 value = dates ,
@@ -332,6 +334,8 @@ def contains_none(self, dates: List[datetime]) -> _Filters:
332334 Args:
333335 dates: List of dates to filter on.
334336 """
337+ if len (dates ) == 0 :
338+ raise WeaviateInvalidInputError ("Filter contains_none must have at least one value" )
335339 return _FilterValue (
336340 target = self ._target_path (),
337341 value = dates ,
You can’t perform that action at this time.
0 commit comments