@@ -254,19 +254,21 @@ func TestCloudFetchIterator(t *testing.T) {
254254 assert .ErrorContains (t , err3 , fmt .Sprintf ("%s %d" , "HTTP error" , http .StatusNotFound ))
255255 })
256256
257- t .Run ("should use custom Transport when provided" , func (t * testing.T ) {
257+ t .Run ("should use custom HTTPClient when provided" , func (t * testing.T ) {
258258 handler = func (w http.ResponseWriter , r * http.Request ) {
259259 w .WriteHeader (http .StatusOK )
260260 w .Write (generateMockArrowBytes (generateArrowRecord ()))
261261 }
262262
263263 startRowOffset := int64 (100 )
264- customTransport := & http.Transport {MaxIdleConns : 10 }
264+ customHTTPClient := & http.Client {
265+ Transport : & http.Transport {MaxIdleConns : 10 },
266+ }
265267
266268 cfg := config .WithDefaults ()
267269 cfg .UseLz4Compression = false
268270 cfg .MaxDownloadThreads = 1
269- cfg .UserConfig .Transport = customTransport
271+ cfg .UserConfig .CloudFetchConfig . HTTPClient = customHTTPClient
270272
271273 bi , err := NewCloudBatchIterator (
272274 context .Background (),
@@ -282,16 +284,15 @@ func TestCloudFetchIterator(t *testing.T) {
282284 assert .Nil (t , err )
283285
284286 cbi := bi .(* batchIterator ).ipcIterator .(* cloudIPCStreamIterator )
285- assert .NotNil (t , cbi .httpClient )
286- assert .Equal (t , customTransport , cbi .httpClient .Transport )
287+ assert .Equal (t , customHTTPClient , cbi .httpClient )
287288
288289 // Verify fetch works
289290 sab , nextErr := bi .Next ()
290291 assert .Nil (t , nextErr )
291292 assert .NotNil (t , sab )
292293 })
293294
294- t .Run ("should fallback to http.DefaultClient when Transport is nil" , func (t * testing.T ) {
295+ t .Run ("should fallback to http.DefaultClient when HTTPClient is nil" , func (t * testing.T ) {
295296 handler = func (w http.ResponseWriter , r * http.Request ) {
296297 w .WriteHeader (http .StatusOK )
297298 w .Write (generateMockArrowBytes (generateArrowRecord ()))
@@ -301,6 +302,8 @@ func TestCloudFetchIterator(t *testing.T) {
301302 cfg := config .WithDefaults ()
302303 cfg .UseLz4Compression = false
303304 cfg .MaxDownloadThreads = 1
305+ // Explicitly set HTTPClient to nil to verify fallback behavior
306+ cfg .UserConfig .CloudFetchConfig .HTTPClient = nil
304307
305308 bi , err := NewCloudBatchIterator (
306309 context .Background (),
0 commit comments