Skip to content

fix: defer response parsing in raise_for_status to error paths only#180

Merged
davidt99 merged 1 commit into
masterfrom
fix/defer-response-parsing-in-raise-for-status
Jul 9, 2026
Merged

fix: defer response parsing in raise_for_status to error paths only#180
davidt99 merged 1 commit into
masterfrom
fix/defer-response-parsing-in-raise-for-status

Conversation

@davidt99

@davidt99 davidt99 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

  • Parse the response JSON body and decode response.reason only when an error is actually raised, instead of on every response passed to raise_for_status.
  • This avoids unnecessary response.json() parsing on successful responses.

Changes

  • intezer_sdk/api.py: moved JSON parsing into the 4xx/5xx branch and reason decoding into the should_raise block.
  • Bump version to 1.27.6 and add CHANGES entry.

🤖 Generated with Claude Code


Generated description

Below is a concise technical summary of the changes proposed in this PR:
Defer parsing the raise_for_status response body and decoding response.reason until error branches run so intezer_sdk.api skips extra work on successful responses. Update package version metadata and the change log to mark the new 1.27.6 release.

TopicDetails
Version bump Update __version__ and add the 1.27.6 entry in CHANGES to document the deferred parsing adjustment.
Modified files (2)
  • CHANGES
  • intezer_sdk/__init__.py
Latest Contributors(2)
UserCommitDate
tufik@intezer.comfix: defer response pa...July 08, 2026
or.saiag@intezer.comfeat/TKT 15221 add ale...May 25, 2026
Error parsing Delay parsing response JSON and decoding response.reason in raise_for_status until the 4xx/5xx branch triggers so only error responses incur the extra work.
Modified files (1)
  • intezer_sdk/api.py
Latest Contributors(2)
UserCommitDate
tufik@intezer.comfix: defer response pa...July 08, 2026
almog@intezer.comfeature(api) - update ...December 17, 2024
Review this PR on Baz | Customize your next review

Parse the response JSON body and decode the reason only when an error is
actually raised, avoiding unnecessary work on successful responses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davidt99 davidt99 merged commit 675a106 into master Jul 9, 2026
8 checks passed
@davidt99 davidt99 deleted the fix/defer-response-parsing-in-raise-for-status branch July 9, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants