Skip to content

Commit 6cbcaf1

Browse files
committed
calling static methods from the class and not the instance
1 parent 16e2b20 commit 6cbcaf1

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

integrations/astra/src/haystack_integrations/document_stores/astra/document_store.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ def count_documents_by_filter(self, filters: dict[str, Any]) -> int:
545545
:param filters: The filters to apply to the document list.
546546
:returns: The number of documents that match the filter.
547547
"""
548-
normalized_filters = self._normalize_new_filter_input(filters)
548+
normalized_filters = AstraDocumentStore._normalize_new_filter_input(filters)
549549
converted_filters = _convert_filters(normalized_filters)
550550
return self.index.count_documents(filters=converted_filters, upper_bound=1_000_000_000)
551551

@@ -559,13 +559,13 @@ def count_unique_metadata_by_filter(self, filters: dict[str, Any], metadata_fiel
559559
:returns: A dictionary where the keys are the metadata field names and the values are the count of unique
560560
values.
561561
"""
562-
normalized_filters = self._normalize_new_filter_input(filters)
562+
normalized_filters = AstraDocumentStore._normalize_new_filter_input(filters)
563563
converted_filters = _convert_filters(normalized_filters)
564564

565565
counts = {}
566566
for field in metadata_fields:
567567
distinct_values = self.index.distinct(f"meta.{field}", filters=converted_filters)
568-
counts[field] = len(self._normalize_distinct_values(distinct_values))
568+
counts[field] = len(AstraDocumentStore._normalize_distinct_values(distinct_values))
569569
return counts
570570

571571
def get_metadata_fields_info(self) -> dict[str, dict[str, str]]:
@@ -619,7 +619,7 @@ def get_metadata_field_unique_values(
619619
:param size: The number of values to return.
620620
:returns: A tuple containing the paginated values and the total count.
621621
"""
622-
values = self._normalize_distinct_values(self.index.distinct(f"meta.{metadata_field}"))
622+
values = AstraDocumentStore._normalize_distinct_values(self.index.distinct(f"meta.{metadata_field}"))
623623
if search_term:
624624
search_term_lower = search_term.lower()
625625
values = [value for value in values if search_term_lower in value.lower()]

0 commit comments

Comments
 (0)