@@ -578,19 +578,22 @@ impl Api {
578578 /// [`reader_into_stream`]. `content_length`, when known, is sent as
579579 /// `Content-Length` so the server can reject an oversized upload up front
580580 /// (the `--url` path may not know the length, hence `Option`).
581+ ///
582+ /// The `Content-Type` is left to the SDK default (`application/octet-stream`):
583+ /// the managed-table load keys off the parquet file extension, not the
584+ /// upload's recorded content type.
581585 pub fn upload_stream (
582586 & self ,
583587 reader : impl std:: io:: Read + Send + ' static ,
584588 content_length : Option < u64 > ,
585- content_type : & str ,
586589 ) -> Result < String , ApiError > {
587590 let mut cfg = self . client . configuration ( ) . clone ( ) ;
588591 cfg. client = upload_reqwest_client ( ) ;
589592 let upload_client = Client :: from_configuration ( cfg) ;
590593
591594 let stream = reader_into_stream ( reader) ;
592595 let resp = rt ( )
593- . block_on ( upload_client. upload_stream ( stream, Some ( content_type ) , content_length) )
596+ . block_on ( upload_client. upload_stream ( stream, None , content_length) )
594597 . map_err ( ApiError :: from_sdk) ?;
595598 Ok ( resp. id )
596599 }
@@ -1350,11 +1353,7 @@ mod tests {
13501353
13511354 let api = Api :: test_new ( & server. url ( ) , "test-jwt" , Some ( "ws-1" ) ) ;
13521355 let id = api
1353- . upload_stream (
1354- std:: io:: Cursor :: new ( payload) ,
1355- Some ( len as u64 ) ,
1356- "application/octet-stream" ,
1357- )
1356+ . upload_stream ( std:: io:: Cursor :: new ( payload) , Some ( len as u64 ) )
13581357 . expect ( "sized upload should succeed" ) ;
13591358
13601359 assert_eq ! ( id, "upload_sized" ) ;
@@ -1382,11 +1381,7 @@ mod tests {
13821381
13831382 let api = Api :: test_new ( & server. url ( ) , "test-jwt" , Some ( "ws-1" ) ) ;
13841383 let id = api
1385- . upload_stream (
1386- std:: io:: Cursor :: new ( payload) ,
1387- None ,
1388- "application/octet-stream" ,
1389- )
1384+ . upload_stream ( std:: io:: Cursor :: new ( payload) , None )
13901385 . expect ( "chunked upload should succeed" ) ;
13911386
13921387 assert_eq ! ( id, "upload_chunked" ) ;
@@ -1411,11 +1406,7 @@ mod tests {
14111406
14121407 let api = Api :: test_new ( & server. url ( ) , "test-jwt" , Some ( "ws-1" ) ) ;
14131408 let err = api
1414- . upload_stream (
1415- std:: io:: Cursor :: new ( payload) ,
1416- Some ( len as u64 ) ,
1417- "application/octet-stream" ,
1418- )
1409+ . upload_stream ( std:: io:: Cursor :: new ( payload) , Some ( len as u64 ) )
14191410 . expect_err ( "a 400 should map to an error" ) ;
14201411
14211412 match err {
0 commit comments