Skip to content

fix(aggregate): request top occurrence values over gRPC - #2195

Draft
ktz03 wants to merge 1 commit into
weaviate:mainfrom
ktz03:fix/weaviate-client-hourly-0639
Draft

ktz03 wants to merge 1 commit into
weaviate:mainfrom
ktz03:fix/weaviate-client-hourly-0639

Conversation

@ktz03

@ktz03 ktz03 commented Oct 9, 2026

Copy link
Copy Markdown

Metrics("title").text(top_occurrences_value=True) currently writes top_occurences=False in the gRPC text aggregation request, so requesting values without occurrence counts does not enable the requested aggregation. Enable the wire flag when either counts or values are requested, matching the GraphQL selection behavior.

The regression tests exercise the public collection.aggregate.over_all() API, mock only the final transport call, and round-trip the actual protobuf requests. They cover all text metric flag combinations, both with and without a top-occurrence limit.

Validation on Windows with Python 3.11.16:

  • Focused aggregation tests: 17 passed. The 16 new cases yield 4 failures and 12 passing controls on unchanged main, and all pass with the fix.
  • Ruff 0.14.7 lint/format and Flake8 with the repository's plugins pass for both changed files. Pyright 1.1.399 reports no errors for the changed source file.
  • Full pytest test with PYTHONUTF8=1: 542 passed, 1 skipped, and 2 timeout-diagnostic stderr assertion failures. Unchanged main reproduces the same two failures (526 passed, 1 skipped).

A running Weaviate server and model inference were not tested.

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

This branch has not been deployed

No deployments
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.

2 participants