Skip to content

fix: keep the code of version 6 working and document what still breaks - #161

Merged
sergioteula merged 1 commit into
masterfrom
claude/breaking-changes-6-3-0-ls38fs
Sep 4, 2026
Merged

fix: keep the code of version 6 working and document what still breaks#161
sergioteula merged 1 commit into
masterfrom
claude/breaking-changes-6-3-0-ls38fs

Conversation

@sergioteula

Copy link
Copy Markdown
Owner

The clients gained arguments and errors gained types since version 6, and
some of that broke code that had no reason to break. Three changes give it
back without giving up what the new behaviour is for:

  • availability sat between item_page and condition in search_items, so a
    caller not using keywords bound every following value to the wrong
    argument, silently. It moves to the end and becomes keyword only, which
    also keeps it from displacing anything in the future.
  • A request that fails to authenticate or is denied raised RequestError
    before it got its own type, so AuthenticationError and AccessDeniedError
    become subclasses of it.
  • An invalid value raised the ValidationError of pydantic or a plain
    ValueError, both ValueError subclasses, so InvalidArgumentError becomes
    one too. An unsupported version now raises it as well, instead of the
    plain ValueError it kept for no reason.

The signatures of both clients and the hierarchy of the errors are pinned
by tests, as they are the promise this commit is making.

What is left breaking is what cannot be given back without restoring a bug,
and is now covered by a migration guide: the errors mapped from the
response, the values the async client no longer sends unvalidated, the
items not found, the timeout and the retries of the requests, the ASIN of a
malformed URL and the configuration each client keeps for itself.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_017bWGetbCpBr2upxna7R5QV

The clients gained arguments and errors gained types since version 6, and
some of that broke code that had no reason to break. Three changes give it
back without giving up what the new behaviour is for:

- availability sat between item_page and condition in search_items, so a
  caller not using keywords bound every following value to the wrong
  argument, silently. It moves to the end and becomes keyword only, which
  also keeps it from displacing anything in the future.
- A request that fails to authenticate or is denied raised RequestError
  before it got its own type, so AuthenticationError and AccessDeniedError
  become subclasses of it.
- An invalid value raised the ValidationError of pydantic or a plain
  ValueError, both ValueError subclasses, so InvalidArgumentError becomes
  one too. An unsupported version now raises it as well, instead of the
  plain ValueError it kept for no reason.

The signatures of both clients and the hierarchy of the errors are pinned
by tests, as they are the promise this commit is making.

What is left breaking is what cannot be given back without restoring a bug,
and is now covered by a migration guide: the errors mapped from the
response, the values the async client no longer sends unvalidated, the
items not found, the timeout and the retries of the requests, the ASIN of a
malformed URL and the configuration each client keeps for itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017bWGetbCpBr2upxna7R5QV
@sergioteula
sergioteula merged commit bf63dd2 into master Sep 4, 2026
7 checks passed
@sergioteula
sergioteula deleted the claude/breaking-changes-6-3-0-ls38fs branch September 4, 2026 14:58
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