Skip to content

Conversation

@Multimo
Copy link
Contributor

@Multimo Multimo commented Nov 24, 2025

issues

Hello, as per issue looking for ways to modify the transport layer of the httpclient that cloudfetch uses. Happy to go another way to solving this, this just seamed like the simplest. Thanks for your work on the driver, its been very useful 👍

@samikshya-db
Copy link
Collaborator

Thanks for making the clean fix, @Multimo !
In the long term we would ideally want to have a single httpClient throughout, with configurable options made available to the user. But as a short term fix, this looks good.

One minor comment on renaming.

connector.go Outdated
}

// WithCloudFetchHTTPClient allows a custom http client to be used for cloud fetch. Default is http.DefaultClient.
func WithCloudFetchHTTPClient(httpClient *http.Client) ConnOption {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we rename this to withHTTPClient ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Also, can you work with WithTransport option in this file for the private network use-case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An alternative, until you merge the two http clients, could be to use have the WithTransport add to the CloudFetchConfig also. I can update to do this if you prefer.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes that would be great! thank you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @samikshya-db, thanks for getting back to me. I have swapped it so same the transport will be re-used between both http clients.Let me know if this is what you had in mind.

@Multimo Multimo force-pushed the multimo/allow-cloudfetch-client-configuration branch from 4929871 to 934d2b5 Compare December 9, 2025 14:46
httpClient := http.DefaultClient
if transport != nil {
httpClient = &http.Client{
Transport: transport,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does this mean a new HttpClient is created on every fetch request when a custom transport is provided? If yes, can we make that more optimal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ya good catch! That would not be ideal. Storing the httpClient in the CloudFetchConfig now so its lifetime is much longer.

Copy link
Collaborator

@samikshya-db samikshya-db left a comment

Choose a reason for hiding this comment

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

Thanks for the great addition! LGTM ✅

(Once you fix the lint issues, we are ready to merge this PR)

@samikshya-db samikshya-db merged commit c4af6fa into databricks:main Dec 17, 2025
2 of 3 checks passed
@samikshya-db
Copy link
Collaborator

Thanks @Multimo !! Merged 🚢

@Multimo
Copy link
Contributor Author

Multimo commented Dec 17, 2025

Thanks @samikshya-db !

@mohammedkhu
Copy link

@Multimo @samikshya-db Just following through some of these PR's, could the fix be also needed for python connector as well for the issue #307 ?
I realize this is only for go based connector.
Context: We are observing similar issue on our python side of things, so wondering if this has to do with this.
Thanks

@samikshya-db
Copy link
Collaborator

Hello @mohammedkhu - can you create an issue in the py connector describing your use-case/ requirements in detail? Open to code contributions there too! Thanks for reaching out.

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.

3 participants