Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: meilisearch/meilisearch-python
Length of output: 8614
🏁 Script executed:
Repository: meilisearch/meilisearch-python
Length of output: 21861
🌐 Web query:
Meilisearch stats API sizeFormat human indexSize usedIndexSize response💡 Result:
In Meilisearch, the stats API endpoints (GET /stats and GET /indexes/{index_uid}/stats) provide metrics regarding database and index size [1][2]. Recent updates to Meilisearch introduced optional query parameters to control the formatting and level of detail for these size metrics [3][4]. Key Query Parameters: - sizeFormat: Accepts either raw (default) or human [3][4]. When set to human, database sizes are returned as strings with appropriate units (e.g., MiB, GiB) instead of numeric byte counts [3][5]. - showInternalDatabaseSizes: A boolean parameter (defaults to false) that, when set to true, includes an internalDatabaseSizes dictionary in the response [3][5]. Regarding indexSize and usedIndexSize: These fields are available in index statistics to provide more granular information about storage usage [6]. indexSize represents the total size of the index database, while usedIndexSize indicates the size of the used pages within that database [6]. Similar to other size metrics, these fields are subject to the formatting specified by the sizeFormat parameter [6]. Note that the specific keys within internalDatabaseSizes are subject to change between versions and should not be relied upon as a strongly typed object in integrations [3][4]. Top Results: [1][2][6][3][4]
Citations:
Accept human-formatted size values.
When
Index.get_stats(size_format="human")returns unit-bearing strings such as"1.5 GiB"for these fields,IndexStats(**stats)rejects them because both annotations allow onlyint | None. Change both fields toint | str | Noneand add coverage for raw and human formats.🤖 Prompt for AI Agents
Source: MCP tools