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

Catch additional edge case in the counts API #623

Merged
merged 1 commit into from
Apr 8, 2022

Conversation

SamHames
Copy link
Contributor

@SamHames SamHames commented Apr 6, 2022

A search for only a user that doesn't exist like "from:10", doesn't
return any data, just immediately creates a response with a meta
key indicating there are zero matching tweets. This conflicts with
the workaround to catch early termination of counts, and was leading
to errors being raised.

This change now differentiates between the two failure modes,
by checking if any rows of data have been returned previously,
or if this is an immediate early termination like happens when
a user doesn't exist anymore.

Closes #615, at least partly - there may be other edge cases lurking.

A search for only a user that doesn't exist like "from:10", doesn't
return any data, just immediately creates a response with a meta
key indicating there are zero matching tweets. This conflicts with
the workaround to catch early termination of counts, and was leading
to errors being raised.

This change now differentiates between the two failure modes,
by checking if any rows of data have been returned previously,
or if this is an immediate early termination like happens when
a user doesn't exist anymore.
@SamHames SamHames requested a review from igorbrigadir April 6, 2022 04:05
@igorbrigadir
Copy link
Contributor

I hope they fix this in the API itself later, but we definitely can't wait for them!

@igorbrigadir igorbrigadir merged commit 52f72a9 into main Apr 8, 2022
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.

Error using searches counts-only with twarc2 from command line
2 participants