Skip to content

Commit

Permalink
fix linting of MetaFieldGroupingRanker (#8570)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakin87 authored Nov 22, 2024
1 parent 5cc2df1 commit 0b2a299
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions haystack/components/rankers/meta_field_grouping_ranker.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ def run(self, documents: List[Document]) -> Dict[str, Any]:
no_group_docs.append(doc)

ordered_docs = []
for group in document_groups:
for subgroup in document_groups[group]:
docs = document_groups[group][subgroup]
for subgroups in document_groups.values():
for docs in subgroups.values():
if self.sort_docs_by:
docs.sort(key=lambda d: d.meta.get(cast(str, self.sort_docs_by), float("inf")))
ordered_docs.extend(docs)
Expand Down

0 comments on commit 0b2a299

Please sign in to comment.