Skip to content
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

Merged
merged 14 commits into from
Jul 28, 2023
Merged

Add numberOfVectors to get_stats api #553

merged 14 commits into from
Jul 28, 2023

Conversation

wanliAlex
Copy link
Collaborator

  • 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

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added / updated (for bug fixes / features)

Copy link
Collaborator

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:
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! added!

Copy link
Collaborator

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)

@wanliAlex wanliAlex temporarily deployed to marqo-test-suite July 27, 2023 11:02 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite July 27, 2023 11:07 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite July 28, 2023 02:23 — with GitHub Actions Inactive
@wanliAlex wanliAlex temporarily deployed to marqo-test-suite July 28, 2023 02:23 — with GitHub Actions Inactive
@wanliAlex wanliAlex merged commit 9385e3b into mainline Jul 28, 2023
@wanliAlex wanliAlex deleted the li/numberOfVectors branch July 28, 2023 03:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants