Skip to content

Switch to httpx#21

Merged
Pierlou merged 2 commits intomainfrom
refactor/httpx
Aug 29, 2025
Merged

Switch to httpx#21
Pierlou merged 2 commits intomainfrom
refactor/httpx

Conversation

@Pierlou
Copy link
Copy Markdown
Collaborator

@Pierlou Pierlou commented Aug 29, 2025

For improved perfs

Copy link
Copy Markdown
Contributor

@bolinocroustibat bolinocroustibat left a comment

Choose a reason for hiding this comment

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

Great, LGTM!

I wonder if would could optimize even further by reusing the open connection by not instanciating a new httpx.Client() everytime but reusing the existing one if it's still alive, like this proposal on hydra datagouv/hydra#325

@Pierlou
Copy link
Copy Markdown
Collaborator Author

Pierlou commented Aug 29, 2025

I wonder if would could optimize even further by reusing the open connection by not instanciating a new httpx.Client() everytime but reusing the existing one if it's still alive

It is already the case if using the syntax:

client = Client()
dat = client.dataset("6789251f3a805425afee55e6")
org = client.organization("534fff81a3a7292c64a77e5c")

but indeed not when doing:

dat = Dataset("6789251f3a805425afee55e6")
org = Organization("534fff81a3a7292c64a77e5c")

Definitely could be an improvement!

@Pierlou Pierlou merged commit ec16de8 into main Aug 29, 2025
5 checks passed
@Pierlou Pierlou deleted the refactor/httpx branch August 29, 2025 14:27
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