Skip to content

Exception when no ranking field is provided #7

@mateuszmrozewski

Description

@mateuszmrozewski
    if rank_descending:
        sorted_ranked_query_result_set = sorted(dedup_query_result_list, 
                                                key=lambda result: (result.__partial_match_search__primary_rank,
                                                getattr(result, ranking_field)), reverse=True)
    else:
        sorted_ranked_query_result_set = sorted(dedup_query_result_list, 
                                                key=lambda result: (-result.__partial_match_search__primary_rank,
                                                getattr(result, ranking_field)))

This part of code raises execption on getattr() when no ranking_field is provided. Considering the doc and function arguments this should be a valid usage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions