weaviate / weaviate/weaviate-python-client
Potentially incorrect parameter name for `min_occurrences `
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 227
- Forks
- 151
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 11
Description
The GQL syntax takes a limit param - and we've called the resulting parameter a min_occurrences in the Metric class. But in reality it seems to be a resulting object limit, as used in query.
Example use:
for c in [1, 5]:
response = chats.aggregate.over_all(
return_metrics=Metrics("company_author").text(
top_occurrences_count=True,
top_occurrences_value=True,
min_occurrences=c,
),
)
print(response.properties["company_author"])
Response:
AggregateText(count=None, top_occurrences=[TopOccurrence(count=26351, value='AmazonHelp')])
AggregateText(count=None, top_occurrences=[TopOccurrence(count=26351, value='AmazonHelp'), TopOccurrence(count=15397, value='AppleSupport'), TopOccurrence(count=10876, value='Uber_Support'), TopOccurrence(count=6686, value='Delta'), TopOccurrence(count=6477, value='AmericanAir')])
If this is correct, maybe we could overload the Metrics.text class to take a limit parameter.
And maybe if someone uses min_occurrences it could be shown as deprecated?
If confirmed, the docs also need to be edited accordingly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the GQL limit parameter with the Metrics.text API and its min_occurrences behavior, then review the related documentation. Confirm whether the parameter limits returned objects, decide how the existing name should be handled, and update the API and docs consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, documentation
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100