hyparquet/test
Sean Lynch 725545731d
Support endpoints that don't support range requests in asyncBufferFromUrl (#57)
* Support endpoints that don't support range requests in asyncBufferFromUrl

Before this commit asyncBufferFromUrl assumes that the body of whatever
successful response it gets is equivalent to the range it requested. If
the origin server does not support HTTP range requests then this
assumption is usually wrong and will lead to parsing failures.

This commit changes asyncBufferFromUrl to change its behaviour slightly
based on the status code in the response:
- if 200 then we got the whole parquet file as the response. Save it and
  use the resulting ArrayBuffer to serve all future slice calls.
- if 206 then we got a range response and we can just return that.

I have also included some test cases to ensure that such responses are
handled correctly and also tweaked other existing mocks to also include
the relevant status code.

* Fix all lint warnings

* replace switch with if-else
2025-01-16 11:55:05 -08:00
..
files Update README with Awaitable 2024-12-21 15:31:59 -08:00
assemble.test.js Fix handling of multiple pages 2024-06-07 23:16:04 -07:00
asyncbuffer.test.js build types before publishing to npm (#46) 2024-12-02 17:47:42 +01:00
column.test.js factor tests with it.for() (#55) 2024-12-20 09:53:56 +01:00
convert.test.js build types before publishing to npm (#46) 2024-12-02 17:47:42 +01:00
encoding.test.js Bit pack testing 2024-06-13 21:33:28 -07:00
helpers.js Validate url for asyncBufferFromUrl 2024-12-17 09:25:54 -08:00
indexes.test.js Parse column and offset indexes (#29) 2024-08-18 18:23:54 -07:00
metadata.test.js utils: asyncBufferFromFile 2024-07-26 15:07:47 -07:00
package.test.js Update dependencies 2024-11-29 14:11:04 -08:00
plain.test.js Remove unnecessary parens 2024-05-18 18:26:52 -07:00
query.test.js Query filter (#56) 2024-12-21 15:23:57 -08:00
read.test.js Promisified parquetReadObjects function 2024-08-20 11:30:39 -07:00
readFiles.test.js utils: asyncBufferFromFile 2024-07-26 15:07:47 -07:00
schema.test.js build types before publishing to npm (#46) 2024-12-02 17:47:42 +01:00
schemaTree.test.js utils: asyncBufferFromFile 2024-07-26 15:07:47 -07:00
snappy.test.js Snappy jpg test 2024-04-12 23:58:37 -07:00
thrift.test.js Parse column and offset indexes (#29) 2024-08-18 18:23:54 -07:00
utils.test.js Support endpoints that don't support range requests in asyncBufferFromUrl (#57) 2025-01-16 11:55:05 -08:00