-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add numberOfVectors to get_stats api #553
Conversation
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.
Let's get some edge case and HTTP error tests
nested_doc_count = HttpRequests(config).get(path=F"{index_name}/_stats/docs")["indices"][index_name]["primaries"][ | ||
"docs"]["count"] | ||
vector_count = HttpRequests(config).get(path=f"{index_name}/_search", body=body) \ | ||
["aggregations"]["nested_chunks"]["chunk_count"]["value"] | ||
except KeyError as e: |
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.
nice job catching KeyError.
You may also need to catch TypeError, if you are parsing an unknown dict
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.
thanks! added!
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.
Let's also get some cases where the HTTP response isn't expected (like an unknown dict type because of an error)
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Add numberOfVectors to get_stats api
What is the current behavior? (You can also link to an open issue here)
we only have numberOfDocuments
What is the new behavior (if this is a feature change)?
we now have numberOfVectors attribute
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
no.
Have unit tests been run against this PR? (Has there also been any additional testing?)
running
Related Python client changes (link commit/PR here)
working on
Related documentation changes (link commit/PR here)
working on
Other information:
no
Please check if the PR fulfills these requirements