Skip to content

Make raise_for_status chainable - #2776

Merged
lovelydinosaur merged 9 commits into
encode:masterfrom
trim21:raise_for_status-chain
Aug 1, 2023
Merged

Make raise_for_status chainable#2776
lovelydinosaur merged 9 commits into
encode:masterfrom
trim21:raise_for_status-chain

Conversation

@trim21

@trim21trim21 commented Jul 15, 2023

Copy link
Copy Markdown
Contributor

Summary

make it possible to write code like r = httpx.get('...').raise_for_status().json()

Refs #2775

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

@trim21
trim21force-pushed the raise_for_status-chain branch from a2f8dbe to 00c6795CompareJuly 15, 2023 08:31
@trim21
trim21 marked this pull request as ready for review July 15, 2023 08:37
@lovelydinosaur
lovelydinosaur requested a review from a teamJuly 31, 2023 11:48
@lovelydinosaurlovelydinosaur changed the title [WIP]: make raise_for_status chainableMake raise_for_status chainableJul 31, 2023

@abersheeranabersheeran left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It's a small change, but the experience will be much better.

@lovelydinosaur

Copy link
Copy Markdown
Contributor

Okay great, so...

  • CHANGELOG.
  • Do we want to mention this usage style in the docstring? In the docs?

@zanieb

zanieb commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

I think this usage should be mentioned in the docstring and prose documentation.

@michaeloliverx

Copy link
Copy Markdown
Contributor

Really nice DX improvement here, I see myself using this a lot!

@trim21

trim21 commented Jul 31, 2023

Copy link
Copy Markdown
ContributorAuthor

document updated
changelog added

@lovelydinosaurlovelydinosaur left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Some minor suggestions...

(Other could also be considered)

Comment threaddocs/quickstart.md Outdated
Comment threadCHANGELOG.md Outdated
Comment threaddocs/quickstart.md Outdated
trim21and others added 3 commits August 1, 2023 17:16
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
Co-authored-by: Tom Christie <tom@tomchristie.com>
@lovelydinosaur
lovelydinosaur merged commit 9415af6 into encode:masterAug 1, 2023
@trim21
trim21 deleted the raise_for_status-chain branch August 1, 2023 09:59
@trim21

Copy link
Copy Markdown
ContributorAuthor

is there any ETA on next release?

@lovelydinosaur

Copy link
Copy Markdown
Contributor

If you're up for helping drive a release pull request, then we could fix up a minor point release whenever really.

@karpetrosyan

Copy link
Copy Markdown
Contributor

If you're up for helping drive a release pull request, then we could fix up a minor point release whenever really.

Can we include encode/httpcore#745 in the next httpx release?

First, we should release httpcore with that pull request and then release httpx

@trim21trim21 mentioned this pull request Aug 1, 2023
samclearman pushed a commit to titanmsp/httpx that referenced this pull request Apr 26, 2025
* merge upstream
* lint
* Update test_async_client.py
* update docs
* add example
* Update docs/quickstart.md
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Update CHANGELOG.md
Co-authored-by: Tom Christie <tom@tomchristie.com>
* Update docs/quickstart.md
Co-authored-by: Tom Christie <tom@tomchristie.com>
---------
Co-authored-by: Tom Christie <tom@tomchristie.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@trim21@lovelydinosaur@zanieb@michaeloliverx@karpetrosyan@abersheeran