arrowbricks 5.0.1__tar.gz → 5.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/PKG-INFO +1 -1
  2. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/pyproject.toml +1 -1
  3. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/Cargo.lock +1 -1
  4. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/Cargo.toml +1 -1
  5. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client/download.rs +16 -1
  6. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/LICENSE +0 -0
  7. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/README.md +0 -0
  8. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/.gitignore +0 -0
  9. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/README.md +0 -0
  10. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/examples/duckdb_query.py +0 -0
  11. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/examples/fastapi_sse.py +0 -0
  12. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/proptest-regressions/json_convert.txt +0 -0
  13. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/rustfmt.toml +0 -0
  14. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/arrow_ffi.rs +0 -0
  15. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client/error.rs +0 -0
  16. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client/model.rs +0 -0
  17. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client/sea.rs +0 -0
  18. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client/thrift_rpc.rs +0 -0
  19. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client/volume.rs +0 -0
  20. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/client.rs +0 -0
  21. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/heartbeat.rs +0 -0
  22. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/json_convert.rs +0 -0
  23. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/lib.rs +0 -0
  24. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline/ndjson.rs +0 -0
  25. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline/reorder.rs +0 -0
  26. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline/sea.rs +0 -0
  27. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline/stats.rs +0 -0
  28. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline/test_support.rs +0 -0
  29. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline/thrift_exec.rs +0 -0
  30. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/pipeline.rs +0 -0
  31. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/src/thrift.rs +0 -0
  32. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests/common/mod.rs +0 -0
  33. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests/wiremock_pipeline.rs +0 -0
  34. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests/wiremock_thrift.rs +0 -0
  35. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests/wiremock_volume_files.rs +0 -0
  36. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/conftest.py +0 -0
  37. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_ipc_stream.py +0 -0
  38. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_parameters.py +0 -0
  39. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_stream_ndjson_lines.py +0 -0
  40. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_streaming.py +0 -0
  41. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_thrift.py +0 -0
  42. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_token_provider.py +0 -0
  43. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/test_volume_files.py +0 -0
  44. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/rust/arrowbricks_core/tests_py/thrift_mock.py +0 -0
  45. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/src/arrowbricks/__init__.py +0 -0
  46. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/src/arrowbricks/_core.pyi +0 -0
  47. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/src/arrowbricks/_streaming.py +0 -0
  48. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/src/arrowbricks/client.py +0 -0
  49. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/src/arrowbricks/cursor.py +0 -0
  50. {arrowbricks-5.0.1 → arrowbricks-5.0.2}/src/arrowbricks/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: arrowbricks
3
- Version: 5.0.1
3
+ Version: 5.0.2
4
4
  Requires-Dist: arro3-core>=0.8 ; extra == 'arro3'
5
5
  Provides-Extra: arro3
6
6
  License-File: LICENSE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "arrowbricks"
3
- version = "5.0.1"
3
+ version = "5.0.2"
4
4
  description = "Runs SQL against a Databricks SQL warehouse via the Statement Execution API and hands you the result as Arrow -- a DB-API-ish Cursor (fetchone/fetchmany/fetchall/fetchall_arrow) or NDJSON streaming. Rust/PyO3 core throughout -- zero required runtime dependencies."
5
5
  readme = "README.md"
6
6
  license = "MIT"
@@ -177,7 +177,7 @@ dependencies = [
177
177
 
178
178
  [[package]]
179
179
  name = "arrowbricks_core"
180
- version = "5.0.1"
180
+ version = "5.0.2"
181
181
  dependencies = [
182
182
  "arrow-array",
183
183
  "arrow-buffer",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "arrowbricks_core"
3
- version = "5.0.1"
3
+ version = "5.0.2"
4
4
  edition = "2024"
5
5
  readme = "README.md"
6
6
 
@@ -67,6 +67,21 @@ pub(crate) fn decompress_lz4_frame(compressed: &Bytes) -> Result<Bytes, ApiError
67
67
  Ok(Bytes::from(out))
68
68
  }
69
69
 
70
+ /// Reads the body into one buffer sized from `Content-Length`. Frames are
71
+ /// freed as they are consumed, so a chunk peaks at about its own size instead
72
+ /// of the ~2x `Response::bytes()` reaches while joining collected frames.
73
+ async fn read_body(mut resp: reqwest::Response) -> Result<Bytes, reqwest::Error> {
74
+ // Cap the up-front reservation so a bogus header can't demand gigabytes.
75
+ let Some(len) = resp.content_length().map(|n| n.min(1 << 30) as usize) else {
76
+ return resp.bytes().await;
77
+ };
78
+ let mut buf = Vec::with_capacity(len);
79
+ while let Some(frame) = resp.chunk().await? {
80
+ buf.extend_from_slice(&frame);
81
+ }
82
+ Ok(Bytes::from(buf))
83
+ }
84
+
70
85
  impl DbClient {
71
86
  /// Unauthenticated -- external links are presigned blob-storage URLs,
72
87
  /// same as `_fetch_link_bytes` in the Python client. `compressed` decodes
@@ -99,7 +114,7 @@ impl DbClient {
99
114
  let text = resp.text().await.unwrap_or_default();
100
115
  return Err(ApiError::from_status(status, &text, true));
101
116
  }
102
- let bytes = resp.bytes().await.map_err(|e| ApiError::from_reqwest(e, true))?;
117
+ let bytes = read_body(resp).await.map_err(|e| ApiError::from_reqwest(e, true))?;
103
118
  // Counted here, before decompression -- "downloaded" means bytes
104
119
  // actually received off the wire, which is exactly the smaller,
105
120
  // (usually) LZ4-compressed size `compress_results` exists to
File without changes
File without changes