@@ -279,15 +279,13 @@ def test_get_metadata_fields_info_impl_type_inference(documents, expected, warni
279279 assert warning_fragment in caplog .text
280280
281281
282- def test_get_metadata_field_min_max_impl_strips_meta_prefix_and_errors ():
282+ def test_get_metadata_field_min_max_impl_strips_meta_prefix_and_handles_missing ():
283283 docs = [
284284 Document (content = "a" , meta = {"priority" : 1 }),
285285 Document (content = "b" , meta = {"priority" : 5 }),
286286 ]
287287 assert PineconeDocumentStore ._get_metadata_field_min_max_impl (docs , "meta.priority" ) == {"min" : 1 , "max" : 5 }
288-
289- with pytest .raises (ValueError , match = "No values found" ):
290- PineconeDocumentStore ._get_metadata_field_min_max_impl (docs , "missing" )
288+ assert PineconeDocumentStore ._get_metadata_field_min_max_impl (docs , "missing" ) == {"min" : None , "max" : None }
291289
292290
293291def test_get_metadata_field_unique_values_impl_pagination_search_and_lists ():
@@ -523,25 +521,18 @@ def test_get_metadata_field_min_max_boolean_and_string(self, document_store: Pin
523521 assert min_max ["min" ] == "Alpha"
524522 assert min_max ["max" ] == "Zebra"
525523
526- def test_get_metadata_field_min_max_empty_collection (self , document_store : PineconeDocumentStore ):
527- assert document_store .count_documents () == 0
528- with pytest .raises (ValueError , match = "No values found" ):
529- document_store .get_metadata_field_min_max ("priority" )
530-
531524 def test_get_metadata_field_min_max_no_values (self , document_store : PineconeDocumentStore ):
532525 docs = [
533526 Document (content = "Doc 1" , meta = {"tags" : ["tag1" , "tag2" ]}),
534527 Document (content = "Doc 2" , meta = {"tags" : ["tag3" , "tag4" ]}),
535528 ]
536529 document_store .write_documents (docs )
537530
538- # Try to get min/max for unsupported field type (list)
539- with pytest .raises (ValueError , match = "No values found" ):
540- document_store .get_metadata_field_min_max ("tags" )
531+ # Unsupported field type (list) — no comparable values collected
532+ assert document_store .get_metadata_field_min_max ("tags" ) == {"min" : None , "max" : None }
541533
542- # Try to get min/max for non-existent field
543- with pytest .raises (ValueError , match = "No values found" ):
544- document_store .get_metadata_field_min_max ("nonexistent" )
534+ # Non-existent field
535+ assert document_store .get_metadata_field_min_max ("nonexistent" ) == {"min" : None , "max" : None }
545536
546537 def test_get_metadata_field_unique_values (self , document_store : PineconeDocumentStore ):
547538 docs = [
0 commit comments