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

Potentially incorrect parameter name for topOccurrences #1269

Open
databyjp opened this issue Aug 29, 2024 · 0 comments
Open

Potentially incorrect parameter name for topOccurrences #1269

databyjp opened this issue Aug 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@databyjp
Copy link
Contributor

The GQL syntax takes a limit param - and we've called the resulting parameter a min_threshold 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.

@databyjp databyjp added the bug Something isn't working label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant