You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
importmeilisearchasmsms_client=ms.Client(<host>, <masterkey>)
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
The text was updated successfully, but these errors were encountered:
2mal3
linked a pull request
Apr 9, 2025
that will
close
this issue
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 theIndexStats
class returns the value of the attribute (if it exists).Current behavior
A call to
__getattr__
of theIndexStats
class returns the name of the attribute, not the value.Example
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: