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

Fix bug where --max-results could not be set with --no-context-annota… #648

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

SamHames
Copy link
Contributor

…tions

Previously this command:

twarc2 search --archive --max-results 200 --no-context-annotations banana --limit 100

Would fail with the error:

Error: Invalid value for '--max-results': --max-results cannot be greater
than 100 when using context annotations. Set --no-context-annotations to
remove them, or don't specify them in --tweet-fields.

This was occuring because _validate_max_results is called before
applying --no-context-annotations, this change just checks
no_context_annotations as well.

…tions

Previously this command:

`twarc2 search --archive --max-results 200 --no-context-annotations banana --limit 100`

Would fail with the error:

```
Error: Invalid value for '--max-results': --max-results cannot be greater
than 100 when using context annotations. Set --no-context-annotations to
remove them, or don't specify them in --tweet-fields.
```

This was occuring because _validate_max_results is called before
applying --no-context-annotations, this change just checks
no_context_annotations as well.
@edsu edsu merged commit 89dc893 into main Jul 18, 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.

2 participants