clbarnes commented on PR #5222:
URL: https://github.com/apache/arrow-rs/pull/5222#issuecomment-1876951489

   The tests which were failing were all tests written as part of this effort. 
I think there were a couple of places where the errors' fields were ambiguously 
named and so some of them were the wrong way round, so I've improved the names 
and updated the tests for the new, stricter failure cases.
   
   - users cannot request a 0-byte range
   - `as_range` should raise an error if the first byte requested is after the 
end of the resource, but in practice this should never be hit because the 
server will return a 416 Range Not Satisfiable and that error should bubble up 
first.
   - `as_range` raises an error if the user requests a range ending after the 
end of the resource, even though the server will 206 Partial Content and return 
the valid part of the requested range. This is to behave more like rust slicing 
and let the user know early if they are requesting beyond the length of the 
resource. The downside is that this disallows users implementing their own 
paginated requests, like "I want to request 100 bytes at a time and if I get < 
100 back I'll stop", but I think this is a pretty rare case which should 
probably fetch the resource length with a HEAD first.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to