Skip to content

Add limit parameter to search()/search_v2()#445

Open
Vitexus wants to merge 1 commit into
halcy:masterfrom
Vitexus:feature/search-limit-param
Open

Add limit parameter to search()/search_v2()#445
Vitexus wants to merge 1 commit into
halcy:masterfrom
Vitexus:feature/search-limit-param

Conversation

@Vitexus

@Vitexus Vitexus commented Jul 3, 2026

Copy link
Copy Markdown

Summary

  • /api/v1/search and /api/v2/search accept a limit query parameter, but search()/search_v1()/search_v2() didn't expose it, so passing limit= raised TypeError: got an unexpected keyword argument 'limit'.
  • Adds limit: Optional[int] = None to search() and search_v2() and forwards it through to the API request params via the existing __generate_params(locals()) mechanism (it's dropped automatically when None).
  • search_v1() is left unchanged (pre-2.4.1, and search() already doesn't forward newer-only params to it).

Fixes #444

Test plan

  • Verified via inspect.signature that limit is now accepted by search() / search_v2().
  • No new VCR cassette was recorded (would require a live test instance); a maintainer with the test fixture instance may want to add one exercising limit=.

The /api/v1/search and /api/v2/search endpoints accept a `limit` query
parameter, but search()/search_v1()/search_v2() didn't expose it,
raising a TypeError for any caller passing limit=.

Fixes halcy#444

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@halcy

halcy commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Hey! First of all, thank you, good catch, and thank you for the immediate PR.

I am unfortunately about to go on vacation. I can't promise I will find the time to do a release before that, but I will certainly do so after I am back.

@Ryuno-Ki

Ryuno-Ki commented Jul 7, 2026

Copy link
Copy Markdown

I am unfortunately about to go on vacation.

You've earned it. Enjoy the time! Nothing unfortunate here.

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.

search()/search_v2() do not support the API's limit parameter

3 participants