Skip to content

Commit

Permalink
Merge pull request #648 from DocNow/max_results_with_no_context_annot…
Browse files Browse the repository at this point in the history
…ations

Fix bug where --max-results could not be set with --no-context-annota…
  • Loading branch information
edsu authored Jul 18, 2022
2 parents e215d89 + 73f0e07 commit 89dc893
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion twarc/command2.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def _validate_max_results(context, parameter, value):
)
if value < 10 or value > 500:
raise click.BadParameter("--max-results must be between 10 and 500")
if value > 100 and has_context_annotations:
if value > 100 and (has_context_annotations and not no_context_annotations_set):
raise click.BadParameter(
"--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."
)
Expand Down

0 comments on commit 89dc893

Please sign in to comment.