|
14 | 14 | from haystack.dataclasses.document import Document |
15 | 15 | from haystack.document_stores.errors import DocumentStoreError |
16 | 16 | from haystack.testing.document_store import ( |
17 | | - DocumentStoreBaseExtendedTests, |
18 | | - create_filterable_docs, |
19 | 17 | CountDocumentsByFilterTest, |
20 | 18 | CountUniqueMetadataByFilterTest, |
21 | | - GetMetadataFieldsInfoTest, |
| 19 | + DocumentStoreBaseExtendedTests, |
22 | 20 | GetMetadataFieldMinMaxTest, |
| 21 | + GetMetadataFieldsInfoTest, |
23 | 22 | GetMetadataFieldUniqueValuesTest, |
| 23 | + create_filterable_docs, |
24 | 24 | ) |
25 | 25 | from haystack.utils.auth import Secret |
26 | 26 | from numpy import array as np_array |
@@ -947,20 +947,6 @@ def test_count_unique_metadata_by_filter_field_not_found(self, document_store): |
947 | 947 | metadata_fields=["nonexistent_field"], |
948 | 948 | ) |
949 | 949 |
|
950 | | - def test_get_metadata_field_unique_values(self, document_store): |
951 | | - docs = [ |
952 | | - Document(content="Doc 1", meta={"category": "TypeA"}), |
953 | | - Document(content="Doc 2", meta={"category": "TypeB"}), |
954 | | - Document(content="Doc 3", meta={"category": "TypeA"}), |
955 | | - Document(content="Doc 4", meta={"category": "TypeC"}), |
956 | | - Document(content="Doc 5", meta={"category": "TypeB"}), |
957 | | - ] |
958 | | - document_store.write_documents(docs) |
959 | | - |
960 | | - values, total_count = document_store.get_metadata_field_unique_values("category") |
961 | | - assert total_count == 3 |
962 | | - assert set(values) == {"TypeA", "TypeB", "TypeC"} |
963 | | - |
964 | 950 | def test_get_metadata_field_unique_values_with_meta_prefix(self, document_store): |
965 | 951 | docs = [ |
966 | 952 | Document(content="Doc 1", meta={"category": "TypeA"}), |
@@ -1114,8 +1100,8 @@ def test_get_metadata_field_min_max_empty_collection(document_store): |
1114 | 1100 | # "number" which IS declared in the fixture's collection_settings. |
1115 | 1101 | assert document_store.count_documents() == 0 |
1116 | 1102 | result = document_store.get_metadata_field_min_max("number") |
1117 | | - assert result["min"] is 0 |
1118 | | - assert result["max"] is 0 |
| 1103 | + assert result["min"] == 0 |
| 1104 | + assert result["max"] == 0 |
1119 | 1105 |
|
1120 | 1106 | @staticmethod |
1121 | 1107 | def test_get_metadata_fields_info_empty_collection(document_store): |
|
0 commit comments