Skip to content

Stats of IndexStats Class not Accessible #1094

Open
@2mal3

Description

@2mal3

Description
If you want to get the statistics of an index with index.get_stats() like here, you get the corresponding data class (IndexStats), but you can't get any values from it with __getattr__, even though it is implemented in the class. Instead, you get the name of the attribute you wanted to access.

Expected behavior
A call to __getattr__ of the IndexStats class returns the value of the attribute (if it exists).

Current behavior
A call to __getattr__ of the IndexStats class returns the name of the attribute, not the value.

Example

import meilisearch as ms
ms_client = ms.Client(<host>, <master key>)
foo_index = ms_client.index("foo")

stats = foo_index.get_stats()
print(stats.numberOfDocuments)	# prints "numberOfDocuments" instead of the actual number of Documents

Environment (please complete the following information):

  • meilisearch-python version: v0.34.1

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