This is an automated email from the ASF dual-hosted git repository.

HyukjinKwon pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark-connect-rust.git


The following commit(s) were added to refs/heads/master by this push:
     new 90058dd8 [SPARK-61492][CONNECT][PYTHON] Upgrade PyO3 to 0.29 and Arrow 
to 59 in Spark Connect Rust, so that the instance dicts of the Python client's 
classes are released and collected
90058dd8 is described below

commit 90058dd833ffa8d80ebd29d251d26ca963bb1a95
Author: Hyukjin Kwon <[email protected]>
AuthorDate: Fri Nov 13 08:50:42 2026 +0900

    [SPARK-61492][CONNECT][PYTHON] Upgrade PyO3 to 0.29 and Arrow to 59 in 
Spark Connect Rust, so that the instance dicts of the Python client's classes 
are released and collected
    
    ### What changes were proposed in this pull request?
    
    This PR upgrades PyO3 from 0.28.3 to 0.29.3 and Arrow from 58.3.0 to 
59.3.2. arrow-pyarrow 59 is the first release line on PyO3 0.29, so the two 
move together. The optional `datafusion` feature moves from DataFusion 53 to 
55.2.0, the release on Arrow 59; no DataFusion release is on Arrow 60 yet.
    
    It removes `crates/pyspark-rs/src/instance_dict.rs`, the `tp_dealloc` 
wrapper of SPARK-61490 that released the instance `__dict__` of the 
`#[pyclass(dict)]` classes. PyO3 0.29 does this itself: it releases the dict at 
dealloc (`release_dict`), keeps the dict that `object.__new__` makes on CPython 
3.11 and 3.12, and synthesizes `tp_traverse`/`tp_clear` for dict classes, so 
the garbage collector sees the dict. AGENTS.md, `docs/installation.md` and the 
comments that cited PyO3 0.28 or Ar [...]
    
    ### Why are the changes needed?
    
    With PyO3 0.28, every instance of the Python client's dict classes (Column, 
DataFrame, SparkSession, the data types, readers, writers, Observation and 
others) leaked the empty dict that CPython 3.11 and 3.12 create for it, about 
64 bytes. And because PyO3 0.28 GC-tracks a class only if it defines 
`__traverse__`, a reference cycle through an instance dict was never collected, 
while PySpark's plain classes collect it:
    
    ```python
    import gc, weakref
    df = spark.range(1)
    df.me = df
    ref = weakref.ref(df)
    del df
    gc.collect()
    ref()  # PySpark: None. Before: the DataFrame is still alive. After: None.
    ```
    
    Measured on CPython 3.11, 20,000 instances given no attribute kept 
1,289,830 bytes before this change.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes: these leaks and uncollected cycles are gone. There is no API change. 
The `datafusion` feature now needs Rust 1.94, which `docs/installation.md` 
notes; the published crates keep their Rust 1.88 minimum.
    
    ### How was this patch tested?
    
    - New `test_cycles_through_instance_dicts_are_collected_as_pyspark`: a 
cycle through the instance dict of a DataFrame, a Column, an Observation, a 
reader and the conf is collected.
    - `test_freed_instances_given_attributes_keep_no_memory_as_pyspark` now 
also asserts that 20,000 instances given no attribute keep under 20,000 bytes. 
Its old baseline subtraction hid the leak.
    - Both fail with PyO3 0.28 (rebuilt and run on CPython 3.11) and pass with 
0.29.
    - Offline suites (`test_dropin_offline.py`, `test_arrow_handoff.py`, 
`test_ml_offline.py`, `TZ=UTC`) on CPython 3.11, 3.12 and 3.13: 3262 passed and 
8 skipped on each.
    - Python e2e suites against Spark 4.3.0 on 3.11: 358 passed, 1 skipped.
    - Rust: the lib tests of apache-spark-connect and 
apache-spark-connect-core, the lib tests with `datafusion,polars`, the 
`--no-run` builds of the default, `wasm-udf` and `datafusion,polars` targets, 
and the Rust e2e suites. One e2e test, which parses `timestamp(9)`, needs 
`spark.sql.timestampNanosTypes.enabled` on the server and failed only for that 
reason on the local server; that test is unchanged.
    - No crate that the Rust 1.88 MSRV job checks declares a `rust-version` 
above 1.88.
    - `cargo check --workspace --all-targets`, `cargo fmt`, 
`scripts/audit_no_stubs.sh`, and ruff 0.14.0 `check` and `format --check` pass.
    
    ### Was this patch authored or co-authored using generative AI tooling?
    
    Generated-by: Claude Opus 5.5
    
    This pull request and its description were written by Isaac.
    
    Closes #579 from HyukjinKwon/SPARK-61492-pyo3-029.
    
    Authored-by: Hyukjin Kwon <[email protected]>
    Signed-off-by: Hyukjin Kwon <[email protected]>
---
 AGENTS.md                               |  21 +-
 Cargo.lock                              | 402 +++++++++++++++++---------------
 Cargo.toml                              |  11 +-
 crates/pyspark-rs/src/instance_dict.rs  | 227 ------------------
 crates/pyspark-rs/src/lib.rs            |   5 -
 crates/pyspark-rs/src/pyarrow_export.rs |  14 +-
 crates/pyspark-rs/src/row.rs            |   2 +-
 crates/pyspark-rs/src/values.rs         |   5 +-
 crates/spark-connect/src/arrow_input.rs |   2 +-
 docs/installation.md                    |   2 +-
 python/tests/test_dropin_offline.py     |  34 ++-
 11 files changed, 268 insertions(+), 457 deletions(-)

diff --git a/AGENTS.md b/AGENTS.md
index ce370c37..75f22b91 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -429,19 +429,14 @@ For every method matching a pyspark name:
 - **Value classes:** `crates/pyspark-rs/src/values.py` embeds PySpark's plain 
classes
   `VariantVal`, `Geometry` and `Geography` the same way, exported by 
`pyspark._pyspark`, so
   their attributes are the instance attributes of PySpark's, as given, and 
they pickle as plain
-  classes into the server's Python workers. Do not make them 
`#[pyclass(dict)]` types: PyO3 0.28
-  clears but never releases the `__dict__` of such an instance, so each value 
would keep a dict.
-- **Instance dicts of `#[pyclass(dict)]` classes:** PyO3 0.28's dealloc 
empties the `__dict__` of
-  an instance (`PyDict_Clear`) but never releases it. 
`crates/pyspark-rs/src/instance_dict.rs`
-  wraps, at module init, the `tp_dealloc` of each class whose instances have 
the dict: the wrapper
-  takes the dict out of its slot, runs PyO3's dealloc and then releases the 
dict, so the attribute
-  semantics stay CPython's (a `__getattr__`/`__setattr__` store instead would 
break the lookup
-  order of monkeypatched methods and slow every access). List there every new 
`dict` class and
-  every class that `extends` one, whose Rust dealloc does not go through its 
base's slot; Python
-  subclasses go through it. On CPython 3.11 and 3.12, PyO3 0.28 also writes 
over the dict that
-  `object.__new__` makes for every instance of such a class, which no code 
outside PyO3 can reach:
-  a `dict` class still costs a dict per instance there (hence the value 
classes above) until the
-  PyO3 0.29 upgrade, after which the module is to be removed.
+  classes into the server's Python workers. Keep them plain Python classes 
rather than
+  `#[pyclass(dict)]` types, so that their instances and pickles are PySpark's 
own.
+- **Instance dicts of `#[pyclass(dict)]` classes:** PyO3 0.29 releases the 
`__dict__` of an
+  instance when the instance is freed, keeps the dict that `object.__new__` 
makes for it on
+  CPython 3.11 and 3.12, and synthesizes `tp_traverse` and `tp_clear` for a 
dict class, so a
+  reference cycle through an instance dict is collected. No code of the 
extension wraps the
+  `tp_dealloc` of a class any more. (PyO3 0.28 did not do any of this, which 
needed the
+  `instance_dict` wrapper of SPARK-61490; that module was removed with the 
upgrade.)
 - **Streaming listeners and progress holders:** Keep progress holders 
(`StreamingQueryProgress`,
   `StateOperatorProgress`, etc.) as faithful pure-Python implementations 
parsed from server
   JSON, not Rust-backed. The listener bus (subscribe/dispatch) is genuinely 
Rust-backed;
diff --git a/Cargo.lock b/Cargo.lock
index 07a6ef8c..0fd14aef 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -114,7 +114,7 @@ version = "4.3.0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -167,9 +167,9 @@ checksum = 
"7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50"
 
 [[package]]
 name = "arrow"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "378530e55cd479eda3c14eb345310799717e6f76d0c332041e8487022166b471"
+checksum = "3f04e0a89cc175eaf3740282537851e6fd9d7276f97730b9d0ea2859c11a85df"
 dependencies = [
  "arrow-arith",
  "arrow-array",
@@ -189,9 +189,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-arith"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a0ab212d2c1886e802f51c5212d78ebbcbb0bec980fff9dadc1eb8d45cd0b738"
+checksum = "157943c720919e8f5b6731407ce5cd4c9a5ef47a75bf10edaf24b7081b5763ef"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -203,9 +203,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-array"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "cfd33d3e92f207444098c75b42de99d329562be0cf686b307b097cc52b4e999e"
+checksum = "72b5b1682924f11ecf6929689c16cbc69efbb6dd141b06ad98ee1cb10d858c43"
 dependencies = [
  "ahash",
  "arrow-buffer",
@@ -215,6 +215,7 @@ dependencies = [
  "chrono-tz",
  "half",
  "hashbrown 0.17.1",
+ "libc",
  "num-complex",
  "num-integer",
  "num-traits",
@@ -222,9 +223,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-buffer"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "0c6cd424c2693bcdbc150d843dc9d4d137dd2de4782ce6df491ad11a3a0416c0"
+checksum = "b5d687afc6c927965a8a759f3b68de91933d9dfa2e1bb6e156bac84b85665e92"
 dependencies = [
  "bytes",
  "half",
@@ -234,9 +235,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-cast"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4c5aefb56a2c02e9e2b30746241058b85f8983f0fcff2ba0c6d09006e1cded7f"
+checksum = "3f23c3379feede42135ef27ca60e67f6e643cd4343ae74e4c8b16c83f55afd85"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -245,7 +246,7 @@ dependencies = [
  "arrow-schema",
  "arrow-select",
  "atoi",
- "base64 0.22.1",
+ "base64 0.23.1",
  "chrono",
  "comfy-table",
  "half",
@@ -256,9 +257,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-csv"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e94e8cf7e517657a52b91ea1263acf38c4ca62a84655d72458a3359b12ab97de"
+checksum = "85b1984628b091b8319b3c305fce21d04f9e9b2578bb733b0d0108462ae1d698"
 dependencies = [
  "arrow-array",
  "arrow-cast",
@@ -271,9 +272,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-data"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "3c88210023a2bfee1896af366309a3028fc3bcbd6515fa29a7990ee1baa08ee0"
+checksum = "bb0a031c7ff5e2bdb443117054fb466af1d4df5b7f0ecbe197713dc8b113b1ba"
 dependencies = [
  "arrow-buffer",
  "arrow-schema",
@@ -284,9 +285,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-ipc"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "238438f0834483703d88896db6fe5a7138b2230debc31b34c0336c2996e3c64f"
+checksum = "f5dd1afadda2eb821aaf851bb4c0adef60c30cc0f1a29bd02fb99dd07fb9f58d"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -300,9 +301,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-json"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "205ca2119e6d679d5c133c6f30e68f027738d95ed948cf77677ea69c7800036b"
+checksum = "e2bc4d56a0dad84cc51c5812ccff48b642047a1f3be80349cd84318983e79edb"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -325,9 +326,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-ord"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "1bffd8fd2579286a5d63bac898159873e5094a79009940bcb42bbfce4f19f1d0"
+checksum = "561b8209faa2cd489764b7fd07d7cb9e8d274d78048c38de59f77c41140cb834"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -338,9 +339,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-pyarrow"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d29abdf672a81c1aeb57fd2661457f9918964d49aed0e9f18932535f2a9e49ce"
+checksum = "ba037102b3f52163f96db970209ada931c2a6f46c4607d3170950d075db68773"
 dependencies = [
  "arrow-array",
  "arrow-data",
@@ -350,9 +351,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-row"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "bab5994731204603c73ba69267616c50f80780774c6bb0476f1f830625115e0c"
+checksum = "0d8c68b87a569f92b90c46cb0a09d86bd9609ddc9b1bf1fc5a503c8c6907c14e"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -363,9 +364,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-schema"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "f633dbfdf39c039ada1bf9e34c694816eb71fbb7dc78f613993b7245e078a1ed"
+checksum = "e87acb0c6bf6237fca7a50d7b51e801c98a18a5fe6f3bb34f7d77b85ca165388"
 dependencies = [
  "bitflags",
  "serde_core",
@@ -374,9 +375,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-select"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8cd065c54172ac787cf3f2f8d4107e0d3fdc26edba76fdf4f4cc170258942222"
+checksum = "c844141958d805b47d1208e0d12aac53fcf388ce8011639fe82aa492adde0bb4"
 dependencies = [
  "ahash",
  "arrow-array",
@@ -388,9 +389,9 @@ dependencies = [
 
 [[package]]
 name = "arrow-string"
-version = "58.3.0"
+version = "59.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "29dd7cda3ab9692f43a2e4acc444d760cc17b12bb6d8232ddf64e9bab7c06b42"
+checksum = "bc130892b1a9552da77971924b390e06cf375d1f7e4344a7b7b40ca4426fa470"
 dependencies = [
  "arrow-array",
  "arrow-buffer",
@@ -434,7 +435,7 @@ checksum = 
"c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -445,7 +446,7 @@ checksum = 
"9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -533,6 +534,12 @@ version = "0.22.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
 
+[[package]]
+name = "base64"
+version = "0.23.1"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5"
+
 [[package]]
 name = "bincode"
 version = "2.0.1"
@@ -614,7 +621,7 @@ checksum = 
"f9abbd1bc6865053c427f7198e6af43bfdedc55ab791faed4fbd361d789575ff"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -891,14 +898,13 @@ dependencies = [
 
 [[package]]
 name = "datafusion"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "93db0e623840612f7f2cd757f7e8a8922064192363732c88692e0870016e141b"
+checksum = "4cd5317db77ba6bca25c761a8091b9d294a9f4188e4f9dcd0243e6a57de862ac"
 dependencies = [
  "arrow",
  "arrow-schema",
  "async-trait",
- "bytes",
  "chrono",
  "datafusion-catalog",
  "datafusion-catalog-listing",
@@ -923,12 +929,11 @@ dependencies = [
  "datafusion-physical-plan",
  "datafusion-session",
  "futures",
- "itertools",
+ "indexmap",
+ "itertools 0.15.0",
  "log",
  "object_store",
  "parking_lot",
- "rand 0.9.4",
- "regex",
  "tempfile",
  "tokio",
  "url",
@@ -937,9 +942,9 @@ dependencies = [
 
 [[package]]
 name = "datafusion-catalog"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "37cefde60b26a7f4ff61e9d2ff2833322f91df2b568d7238afe67bde5bdffb66"
+checksum = "f35d36794509b7bfcbf90e11a1b5e4d047123c34610105e2e80a2048351cdb2f"
 dependencies = [
  "arrow",
  "async-trait",
@@ -953,7 +958,7 @@ dependencies = [
  "datafusion-physical-plan",
  "datafusion-session",
  "futures",
- "itertools",
+ "itertools 0.15.0",
  "log",
  "object_store",
  "parking_lot",
@@ -962,9 +967,9 @@ dependencies = [
 
 [[package]]
 name = "datafusion-catalog-listing"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "17e112307715d6a7a331111a4c2330ff54bc237183511c319e3708a4cff431fb"
+checksum = "a6454bfb7f43b83942e2ca2576fd09342eedbd0d323e1eef72c3c8e4d57d7203"
 dependencies = [
  "arrow",
  "async-trait",
@@ -978,38 +983,41 @@ dependencies = [
  "datafusion-physical-expr-common",
  "datafusion-physical-plan",
  "futures",
- "itertools",
+ "itertools 0.15.0",
  "log",
  "object_store",
+ "percent-encoding",
 ]
 
 [[package]]
 name = "datafusion-common"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d72a11ca44a95e1081870d3abb80c717496e8a7acb467a1d3e932bb636af5cc2"
+checksum = "d26626e12b224b83351239465dcd00f72d47b02fb5e5b65a643e2dc8ed37f687"
 dependencies = [
- "ahash",
  "arrow",
  "arrow-ipc",
+ "arrow-schema",
  "chrono",
+ "foldhash 0.2.0",
  "half",
- "hashbrown 0.16.1",
+ "hashbrown 0.17.1",
  "indexmap",
- "itertools",
+ "itertools 0.15.0",
  "libc",
  "log",
+ "num-traits",
  "object_store",
- "paste",
  "tokio",
+ "uuid",
  "web-time",
 ]
 
 [[package]]
 name = "datafusion-common-runtime"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "89f4afaed29670ec4fd6053643adc749fe3f4bc9d1ce1b8c5679b22c67d12def"
+checksum = "a106420cbfa980f242c22243ae9a6cce661d4d86ce96cff87dacabf7754a4470"
 dependencies = [
  "futures",
  "log",
@@ -1018,9 +1026,9 @@ dependencies = [
 
 [[package]]
 name = "datafusion-datasource"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e9fb386e1691355355a96419978a0022b7947b44d4a24a6ea99f00b6b485cbb6"
+checksum = "210aa1e9525e9454f2399dbb8b0b95510145bd8c1fdc35de74e9ccbf81bcb699"
 dependencies = [
  "arrow",
  "async-trait",
@@ -1037,9 +1045,10 @@ dependencies = [
  "datafusion-session",
  "futures",
  "glob",
- "itertools",
+ "itertools 0.15.0",
  "log",
  "object_store",
+ "parking_lot",
  "rand 0.9.4",
  "tokio",
  "url",
@@ -1047,9 +1056,9 @@ dependencies = [
 
 [[package]]
 name = "datafusion-datasource-arrow"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ffa6c52cfed0734c5f93754d1c0175f558175248bf686c944fb05c373e5fc096"
+checksum = "65b1b041688cad707fa103c3e7f4c6d89b3134ebf67da0129070dad3381851eb"
 dependencies = [
  "arrow",
  "arrow-ipc",
@@ -1064,16 +1073,16 @@ dependencies = [
  "datafusion-physical-plan",
  "datafusion-session",
  "futures",
- "itertools",
+ "itertools 0.15.0",
  "object_store",
  "tokio",
 ]
 
 [[package]]
 name = "datafusion-datasource-csv"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "503f29e0582c1fc189578d665ff57d9300da1f80c282777d7eb67bb79fb8cdca"
+checksum = "2a7b34e253c4fa5251f174977af910a2f2ec831ec39dbbb56b29ce505cff278b"
 dependencies = [
  "arrow",
  "async-trait",
@@ -1094,9 +1103,9 @@ dependencies = [
 
 [[package]]
 name = "datafusion-datasource-json"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e33804749abc8d0c8cb7473228483cb8070e524c6f6086ee1b85a64debe2b3d2"
+checksum = "1663338f43be6a5746473008e2d0fbde282577ddf0bae90d6c7386e988d71b29"
 dependencies = [
  "arrow",
  "async-trait",
@@ -1111,27 +1120,26 @@ dependencies = [
  "datafusion-session",
  "futures",
  "object_store",
- "serde_json",
  "tokio",
  "tokio-stream",
 ]
 
 [[package]]
 name = "datafusion-doc"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8de6ac0df1662b9148ad3c987978b32cbec7c772f199b1d53520c8fa764a87ee"
+checksum = "0c2569c2e74a34fcae3a369ab3912d61e41a062592510f11e31b1dae2725ecdc"
 
 [[package]]
 name = "datafusion-execution"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c03c7fbdaefcca4ef6ffe425a5fc2325763bfb426599bb0bf4536466efabe709"
+checksum = "39cfdd5ac0769d1e74a885450e49fde8f63ca7ab41eb479a068564aaea80b837"
 dependencies = [
  "arrow",
  "arrow-buffer",
  "async-trait",
- "chrono",
+ "bytes",
  "dashmap",
  "datafusion-common",
  "datafusion-expr",
@@ -1140,18 +1148,22 @@ dependencies = [
  "log",
  "object_store",
  "parking_lot",
+ "pin-project-lite",
  "rand 0.9.4",
  "tempfile",
+ "tokio",
+ "tokio-util",
  "url",
 ]
 
 [[package]]
 name = "datafusion-expr"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "574b9b6977fedbd2a611cbff12e5caf90f31640ad9dc5870f152836d94bad0dd"
+checksum = "86560fd7df4dda924f5474b588c56e7ae8e96dcf158c7327c9cfe9daff448ec5"
 dependencies = [
  "arrow",
+ "arrow-schema",
  "async-trait",
  "chrono",
  "datafusion-common",
@@ -1161,33 +1173,32 @@ dependencies = [
  "datafusion-functions-window-common",
  "datafusion-physical-expr-common",
  "indexmap",
- "itertools",
- "paste",
+ "itertools 0.15.0",
+ "serde",
  "serde_json",
 ]
 
 [[package]]
 name = "datafusion-expr-common"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7d7c3adf3db8bf61e92eb90cb659c8e8b734593a8f7c8e12a843c7ddba24b87e"
+checksum = "e82e313cf655cf6bc2dce6cbd23bcb0d20236a54a1b09c436615e4bac4d8c49f"
 dependencies = [
  "arrow",
  "datafusion-common",
  "indexmap",
- "itertools",
- "paste",
+ "itertools 0.15.0",
 ]
 
 [[package]]
 name = "datafusion-functions"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "f28aa4e10384e782774b10e72aca4d93ef7b31aa653095d9d4536b0a3dbc51b6"
+checksum = "939ae2771da8a3fdc23ab4de610ae8fef9515476626b49d96d0d5c782b105771"
 dependencies = [
  "arrow",
  "arrow-buffer",
- "base64 0.22.1",
+ "base64 0.23.1",
  "chrono",
  "chrono-tz",
  "datafusion-common",
@@ -1196,24 +1207,23 @@ dependencies = [
  "datafusion-expr",
  "datafusion-expr-common",
  "datafusion-macros",
+ "datafusion-physical-expr-common",
  "hex",
- "itertools",
+ "itertools 0.15.0",
  "log",
  "memchr",
  "num-traits",
  "rand 0.9.4",
  "regex",
- "unicode-segmentation",
  "uuid",
 ]
 
 [[package]]
 name = "datafusion-functions-aggregate"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "00aa6217e56098ba84e0a338176fe52f0a84cca398021512c6c8c5eff806d0ad"
+checksum = "fd6c3aee9f2bc65716787d651e023743a90b4efbc57a2f679f036632e16fb110"
 dependencies = [
- "ahash",
  "arrow",
  "datafusion-common",
  "datafusion-doc",
@@ -1224,18 +1234,17 @@ dependencies = [
  "datafusion-physical-expr",
  "datafusion-physical-expr-common",
  "half",
+ "hashbrown 0.17.1",
  "log",
  "num-traits",
- "paste",
 ]
 
 [[package]]
 name = "datafusion-functions-aggregate-common"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b511250349407db7c43832ab2de63f5557b19a20dfd236b39ca2c04468b50d47"
+checksum = "988b5d3dfb4939d81c2f9fab267063610fe52a843620f2fa6cb2a1598e43369c"
 dependencies = [
- "ahash",
  "arrow",
  "datafusion-common",
  "datafusion-expr-common",
@@ -1244,25 +1253,25 @@ dependencies = [
 
 [[package]]
 name = "datafusion-functions-table"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "72b40d3f5bbb3905f9ccb1ce9485a9595c77b69758a7c24d3ba79e334ff51e7e"
+checksum = "2c767567cce2782d4d0bdfa55fab010aaba0bdbe533509e9e0b9a6a3ee29ed59"
 dependencies = [
  "arrow",
  "async-trait",
  "datafusion-catalog",
  "datafusion-common",
  "datafusion-expr",
+ "datafusion-physical-expr",
  "datafusion-physical-plan",
  "parking_lot",
- "paste",
 ]
 
 [[package]]
 name = "datafusion-functions-window"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "d4e88ec9d57c9b685d02f58bfee7be62d72610430ddcedb82a08e5d9925dbfb6"
+checksum = "0a311c1f558d1f792f1f631c3670da12ee72a20fbf5d6ca151325d66191c03c1"
 dependencies = [
  "arrow",
  "datafusion-common",
@@ -1273,14 +1282,13 @@ dependencies = [
  "datafusion-physical-expr",
  "datafusion-physical-expr-common",
  "log",
- "paste",
 ]
 
 [[package]]
 name = "datafusion-functions-window-common"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "8307bb93519b1a91913723a1130cfafeee3f72200d870d88e91a6fc5470ede5c"
+checksum = "fffd54b8acf6ecef284cc0677e01e1b8c71be64fec50612ba00a0ff0d9b41a52"
 dependencies = [
  "datafusion-common",
  "datafusion-physical-expr-common",
@@ -1288,20 +1296,20 @@ dependencies = [
 
 [[package]]
 name = "datafusion-macros"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "2e367e6a71051d0ebdd29b2f85d12059b38b1d1f172c6906e80016da662226bd"
+checksum = "14d6df9763c8fb968b2417d797aef4c55ac2e4a895aaef38c72c16a287aa4a40"
 dependencies = [
  "datafusion-doc",
  "quote",
- "syn",
+ "syn 3.0.10",
 ]
 
 [[package]]
 name = "datafusion-optimizer"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e929015451a67f77d9d8b727b2bf3a40c4445fdef6cdc53281d7d97c76888ace"
+checksum = "acfb8cea6e05e2e75bae183340cf7d53cccb3db0449e2f1fbc07654d980fd19f"
 dependencies = [
  "arrow",
  "chrono",
@@ -1310,7 +1318,7 @@ dependencies = [
  "datafusion-expr-common",
  "datafusion-physical-expr",
  "indexmap",
- "itertools",
+ "itertools 0.15.0",
  "log",
  "regex",
  "regex-syntax",
@@ -1318,32 +1326,31 @@ dependencies = [
 
 [[package]]
 name = "datafusion-physical-expr"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "4b1e68aba7a4b350401cfdf25a3d6f989ad898a7410164afe9ca52080244cb59"
+checksum = "9f002cef849e10c0597a217ec7891c2796c0f8b42d739f5d24abc24496373406"
 dependencies = [
- "ahash",
  "arrow",
+ "arrow-schema",
  "datafusion-common",
  "datafusion-expr",
  "datafusion-expr-common",
  "datafusion-functions-aggregate-common",
  "datafusion-physical-expr-common",
  "half",
- "hashbrown 0.16.1",
+ "hashbrown 0.17.1",
  "indexmap",
- "itertools",
+ "itertools 0.15.0",
  "parking_lot",
- "paste",
  "petgraph",
  "tokio",
 ]
 
 [[package]]
 name = "datafusion-physical-expr-adapter"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ea22315f33cf2e0adc104e8ec42e285f6ed93998d565c65e82fec6a9ee9f9db4"
+checksum = "82761522c4536e7059d3b185cd99f10525c2bf48f1bd26a0a57e73e19eadc0fb"
 dependencies = [
  "arrow",
  "datafusion-common",
@@ -1351,31 +1358,31 @@ dependencies = [
  "datafusion-functions",
  "datafusion-physical-expr",
  "datafusion-physical-expr-common",
- "itertools",
+ "itertools 0.15.0",
 ]
 
 [[package]]
 name = "datafusion-physical-expr-common"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "b04b45ea8ad3ac2d78f2ea2a76053e06591c9629c7a603eda16c10649ecf4362"
+checksum = "f8c5c67aa252886f4d6b331c8114797f5b140464e774c4da36889269a1bf1bd8"
 dependencies = [
- "ahash",
  "arrow",
  "chrono",
  "datafusion-common",
  "datafusion-expr-common",
- "hashbrown 0.16.1",
+ "hashbrown 0.17.1",
  "indexmap",
- "itertools",
+ "itertools 0.15.0",
  "parking_lot",
+ "pin-project",
 ]
 
 [[package]]
 name = "datafusion-physical-optimizer"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7cb13397809a425918f608dfe8653f332015a3e330004ab191b4404187238b95"
+checksum = "f1a49dd3a76e4879012682c59dc3735282e60640c97483546a4113564a60bf8f"
 dependencies = [
  "arrow",
  "datafusion-common",
@@ -1386,20 +1393,23 @@ dependencies = [
  "datafusion-physical-expr-common",
  "datafusion-physical-plan",
  "datafusion-pruning",
- "itertools",
+ "datafusion-session",
+ "itertools 0.15.0",
 ]
 
 [[package]]
 name = "datafusion-physical-plan"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5edc023675791af9d5fb4cc4c24abf5f7bd3bd4dcf9e5bd90ea1eff6976dcc79"
+checksum = "b1451d6817e5ac0dd21819b19949d1c420ab51d748f55dd9a96ecb5418a24c97"
 dependencies = [
- "ahash",
  "arrow",
+ "arrow-data",
+ "arrow-ipc",
  "arrow-ord",
  "arrow-schema",
  "async-trait",
+ "bytes",
  "datafusion-common",
  "datafusion-common-runtime",
  "datafusion-execution",
@@ -1411,21 +1421,23 @@ dependencies = [
  "datafusion-physical-expr-common",
  "futures",
  "half",
- "hashbrown 0.16.1",
+ "hashbrown 0.17.1",
  "indexmap",
- "itertools",
+ "itertools 0.15.0",
  "log",
  "num-traits",
  "parking_lot",
  "pin-project-lite",
+ "serde",
+ "serde_json",
  "tokio",
 ]
 
 [[package]]
 name = "datafusion-pruning"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "ac8c76860e355616555081cab5968cec1af7a80701ff374510860bcd567e365a"
+checksum = "f11f0dbe2b5a642f6106e44de8bbd6654fa7220ca14f32313d4efd5514a86968"
 dependencies = [
  "arrow",
  "datafusion-common",
@@ -1434,16 +1446,16 @@ dependencies = [
  "datafusion-physical-expr",
  "datafusion-physical-expr-common",
  "datafusion-physical-plan",
- "itertools",
  "log",
 ]
 
 [[package]]
 name = "datafusion-session"
-version = "53.1.0"
+version = "55.2.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "5412111aa48e2424ba926112e192f7a6b7e4ccb450145d25ce5ede9f19dc491e"
+checksum = "62dc5ce37a5ce1ff5362949776829aded2529a11dbaa13d24b0ffa6a059e106a"
 dependencies = [
+ "arrow-schema",
  "async-trait",
  "datafusion-common",
  "datafusion-execution",
@@ -1476,7 +1488,7 @@ checksum = 
"97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -1685,7 +1697,7 @@ checksum = 
"e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -1843,6 +1855,11 @@ name = "hashbrown"
 version = "0.17.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
 checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a"
+dependencies = [
+ "allocator-api2",
+ "equivalent",
+ "foldhash 0.2.0",
+]
 
 [[package]]
 name = "heck"
@@ -2150,6 +2167,15 @@ dependencies = [
  "either",
 ]
 
+[[package]]
+name = "itertools"
+version = "0.15.0"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "8b4baf93f58d4425749ca49a51c50ebab072c5df6994d08fed93541c331481dc"
+dependencies = [
+ "either",
+]
+
 [[package]]
 name = "itoa"
 version = "1.0.18"
@@ -2306,9 +2332,9 @@ dependencies = [
 
 [[package]]
 name = "lz4_flex"
-version = "0.13.1"
+version = "0.14.0"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7ef0d4ed8669f8f8826eb00dc878084aa8f253506c4fd5e8f58f5bce72ddb97e"
+checksum = "ecbdfe44b1bd960b68170b417450a628c43f7cf56bb3c5317e61cb230ee7f226"
 dependencies = [
  "twox-hash",
 ]
@@ -2387,9 +2413,9 @@ dependencies = [
 
 [[package]]
 name = "num-bigint"
-version = "0.4.6"
+version = "0.5.1"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9"
+checksum = "93e7820bc0a80a0238e650327316f929ba18d5be054b647490a3a6a339f3e7c0"
 dependencies = [
  "num-integer",
  "num-traits",
@@ -2412,7 +2438,7 @@ checksum = 
"ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -2480,7 +2506,7 @@ dependencies = [
  "http-body-util",
  "humantime",
  "hyper",
- "itertools",
+ "itertools 0.14.0",
  "parking_lot",
  "percent-encoding",
  "quick-xml",
@@ -2540,12 +2566,6 @@ dependencies = [
  "windows-link 0.2.1",
 ]
 
-[[package]]
-name = "paste"
-version = "1.0.15"
-source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a"
-
 [[package]]
 name = "percent-encoding"
 version = "2.3.2"
@@ -2599,7 +2619,7 @@ checksum = 
"c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -3258,7 +3278,7 @@ source = 
"registry+https://github.com/rust-lang/crates.io-index";
 checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b"
 dependencies = [
  "proc-macro2",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -3287,7 +3307,7 @@ source = 
"registry+https://github.com/rust-lang/crates.io-index";
 checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042"
 dependencies = [
  "heck",
- "itertools",
+ "itertools 0.14.0",
  "log",
  "multimap",
  "petgraph",
@@ -3297,7 +3317,7 @@ dependencies = [
  "pulldown-cmark",
  "pulldown-cmark-to-cmark",
  "regex",
- "syn",
+ "syn 2.0.117",
  "tempfile",
 ]
 
@@ -3308,10 +3328,10 @@ source = 
"registry+https://github.com/rust-lang/crates.io-index";
 checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf"
 dependencies = [
  "anyhow",
- "itertools",
+ "itertools 0.14.0",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -3355,9 +3375,9 @@ dependencies = [
 
 [[package]]
 name = "pyo3"
-version = "0.28.3"
+version = "0.29.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "91fd8e38a3b50ed1167fb981cd6fd60147e091784c427b8f7183a7ee32c31c12"
+checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
 dependencies = [
  "libc",
  "once_cell",
@@ -3369,18 +3389,18 @@ dependencies = [
 
 [[package]]
 name = "pyo3-build-config"
-version = "0.28.3"
+version = "0.29.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "e368e7ddfdeb98c9bca7f8383be1648fd84ab466bf2bc015e94008db6d35611e"
+checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
 dependencies = [
  "target-lexicon",
 ]
 
 [[package]]
 name = "pyo3-ffi"
-version = "0.28.3"
+version = "0.29.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "7f29e10af80b1f7ccaf7f69eace800a03ecd13e883acfacc1e5d0988605f651e"
+checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
 dependencies = [
  "libc",
  "pyo3-build-config",
@@ -3388,27 +3408,26 @@ dependencies = [
 
 [[package]]
 name = "pyo3-macros"
-version = "0.28.3"
+version = "0.29.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "df6e520eff47c45997d2fc7dd8214b25dd1310918bbb2642156ef66a67f29813"
+checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
 dependencies = [
  "proc-macro2",
  "pyo3-macros-backend",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
 name = "pyo3-macros-backend"
-version = "0.28.3"
+version = "0.29.3"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "c4cdc218d835738f81c2338f822078af45b4afdf8b2e33cbb5916f108b813acb"
+checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
 dependencies = [
  "heck",
  "proc-macro2",
- "pyo3-build-config",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -3616,7 +3635,7 @@ source = 
"registry+https://github.com/rust-lang/crates.io-index";
 checksum = "76009fbe0614077fc1a2ce255e3a1881a2e3a3527097d5dc6d8212c585e7e38b"
 dependencies = [
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -3900,7 +3919,7 @@ checksum = 
"d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4054,7 +4073,7 @@ checksum = 
"028e551d5e270b31b9f3ea271778d9d827148d4287a5d96167b6bb9787f5cc38"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4112,7 +4131,7 @@ dependencies = [
  "heck",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4132,6 +4151,17 @@ dependencies = [
  "unicode-ident",
 ]
 
+[[package]]
+name = "syn"
+version = "3.0.10"
+source = "registry+https://github.com/rust-lang/crates.io-index";
+checksum = "4ae9ccbea3a7b0b09443036490c8f34a8b1b760fd345e5c0dae0aac718faea79"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
 [[package]]
 name = "sync_wrapper"
 version = "1.0.2"
@@ -4149,7 +4179,7 @@ checksum = 
"728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4202,7 +4232,7 @@ checksum = 
"ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4271,7 +4301,7 @@ checksum = 
"385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4349,7 +4379,7 @@ dependencies = [
  "prettyplease",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4374,7 +4404,7 @@ dependencies = [
  "prost-build",
  "prost-types",
  "quote",
- "syn",
+ "syn 2.0.117",
  "tempfile",
  "tonic-build",
 ]
@@ -4447,7 +4477,7 @@ checksum = 
"7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4664,7 +4694,7 @@ dependencies = [
  "bumpalo",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
  "wasm-bindgen-shared",
 ]
 
@@ -4851,7 +4881,7 @@ checksum = 
"053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -4862,7 +4892,7 @@ checksum = 
"3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -5059,7 +5089,7 @@ dependencies = [
  "heck",
  "indexmap",
  "prettyplease",
- "syn",
+ "syn 2.0.117",
  "wasm-metadata",
  "wit-bindgen-core",
  "wit-component",
@@ -5075,7 +5105,7 @@ dependencies = [
  "prettyplease",
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
  "wit-bindgen-core",
  "wit-bindgen-rust",
 ]
@@ -5148,7 +5178,7 @@ checksum = 
"de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
  "synstructure",
 ]
 
@@ -5169,7 +5199,7 @@ checksum = 
"1ae7f38b72ec2a254e2b87ef277cf2cd4fb97cbebf944faa6f33354da0867930"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -5189,7 +5219,7 @@ checksum = 
"11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
  "synstructure",
 ]
 
@@ -5229,7 +5259,7 @@ checksum = 
"625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555"
 dependencies = [
  "proc-macro2",
  "quote",
- "syn",
+ "syn 2.0.117",
 ]
 
 [[package]]
@@ -5258,9 +5288,9 @@ dependencies = [
 
 [[package]]
 name = "zstd-sys"
-version = "2.0.16+zstd.1.5.7"
+version = "2.1.3+zstd.1.5.7"
 source = "registry+https://github.com/rust-lang/crates.io-index";
-checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748"
+checksum = "f729a06d0257428fd9d997ac8db7e1407bd0262ab016b085b36bc52957c0052d"
 dependencies = [
  "cc",
  "pkg-config",
diff --git a/Cargo.toml b/Cargo.toml
index c382d9e0..542a134d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -54,7 +54,7 @@ default-members = [
 version = "4.3.0"
 edition = "2021"
 # The minimum Rust that the dependencies of the published crates need: tonic, 
tonic-prost and
-# tonic-build 0.14 (and DataFusion 53 of the `datafusion` feature) declare 
1.88. CI checks it.
+# tonic-build 0.14 declare 1.88 (the `datafusion` feature needs 1.94, see 
below). CI checks it.
 rust-version = "1.88"
 license = "Apache-2.0"
 repository = "https://github.com/apache/spark-connect-rust";
@@ -75,11 +75,12 @@ tokio-stream = "0.1"
 futures = "0.3"
 
 # Arrow (result decoding).
-arrow = { version = "58", default-features = false, features = ["ipc", 
"ipc_compression", "prettyprint"] }
+arrow = { version = "59", default-features = false, features = ["ipc", 
"ipc_compression", "prettyprint"] }
 
 # DataFusion for the optional to_datafusion() conversion.
-# Pinned to 53 for arrow 58 compatibility.
-datafusion = { version = "53", default-features = false }
+# Pinned to 55 for arrow 59 compatibility. 55 needs Rust 1.94, so only the 
`datafusion` feature
+# needs that much; no DataFusion release is on Arrow 60 yet.
+datafusion = { version = "55", default-features = false }
 
 # Polars for the optional to_polars() conversion. Bridged via Arrow IPC bytes
 # (the `ipc` feature) rather than the polars-arrow/`arrow_rs` path, so polars'
@@ -87,7 +88,7 @@ datafusion = { version = "53", default-features = false }
 polars = { version = "0.54", default-features = false, features = ["ipc"] }
 
 # PyO3 for the pyspark-rs CPython extension.
-pyo3 = { version = "0.28", features = ["extension-module", "abi3-py39"] }
+pyo3 = { version = "0.29", features = ["extension-module", "abi3-py39"] }
 
 # misc
 bytes = "1"
diff --git a/crates/pyspark-rs/src/instance_dict.rs 
b/crates/pyspark-rs/src/instance_dict.rs
deleted file mode 100644
index eb4c0e82..00000000
--- a/crates/pyspark-rs/src/instance_dict.rs
+++ /dev/null
@@ -1,227 +0,0 @@
-//! The release of the instance `__dict__` of the `#[pyclass(dict)]` classes, 
which PyO3 0.28
-//! does not do when an instance is freed.
-//!
-//! PySpark's classes are plain Python classes, whose instance `__dict__` 
CPython releases with
-//! the instance. PyO3 0.28's dealloc of an instance of a `dict` class empties 
the dict
-//! (`PyDict_Clear` in `PyClassObjectContents::dealloc`) but keeps its 
reference to it, so every
-//! instance whose dict was made, by an attribute set, `vars()`, `dir()`, a 
monkeypatched method
-//! or a `__reduce__` that reads it, leaves its dict behind. PyO3 0.29 
releases it
-//! (`release_dict`, a `Py_CLEAR`), but it cannot be used here, as 
arrow-pyarrow pins PyO3 0.28.
-//!
-//! So [`release_instance_dicts`] wraps, at module init, the `tp_dealloc` of 
each class whose
-//! instances have the dict. The wrapper takes the dict out of its slot, runs 
PyO3's dealloc,
-//! which then finds no dict, and releases the dict once the instance is gone, 
as CPython's
-//! `subtype_dealloc` releases it after the weak references are cleared. Its 
items are then freed
-//! by `dict_dealloc`, under CPython's trashcan: PyO3's `PyDict_Clear` freed 
them within the
-//! dealloc, so that freeing a long chain of instances, each an attribute of 
the next, overflowed
-//! the C stack. Only that changes: the dict is still CPython's instance dict, 
which its attribute
-//! lookup reads and writes as before, and freeing an instance, with a dict or 
without, costs a
-//! call and a few loads more.
-//!
-//! A Python subclass keeps the dict slot of its base, and CPython's 
`subtype_dealloc` calls the
-//! `tp_dealloc` of the base, so it is covered. A class that `extends` another 
in Rust has a
-//! `tp_dealloc` of its own, which runs the Rust dealloc of its bases 
directly, so it is wrapped
-//! too: a new `dict` class, or a class that extends one, belongs in the list 
below.
-//!
-//! On CPython 3.11 and 3.12, PyO3 0.28 also loses the dict that 
`object.__new__` makes for each
-//! instance of these classes, as it writes the fields of the instance over 
it. No code of the
-//! extension runs in between, so only PyO3 0.29 fixes that one 
(`create_class_object_of_type`).
-//!
-//! Remove this module after the upgrade to PyO3 0.29 or later. Left in place, 
it is harmless
-//! there: PyO3's own `Py_CLEAR` then finds the slot empty.
-
-use std::ffi::{c_char, c_void};
-use std::sync::OnceLock;
-
-use pyo3::ffi;
-use pyo3::intern;
-use pyo3::prelude::*;
-use pyo3::types::PyType;
-
-use crate::catalog::PyCatalog;
-use crate::column::PyColumn;
-use crate::conf::PyRuntimeConf;
-use crate::dataframe::{
-    PyDataFrame, PyDataFrameNaFunctions, PyDataFrameWriter, 
PyDataFrameWriterV2, PyMergeIntoWriter,
-};
-use crate::datasource::PyDataSourceRegistration;
-use crate::group::{PyCoGroupedData, PyGroupedData};
-use crate::observation::PyObservation;
-use crate::readwriter::PyDataFrameReader;
-use crate::resource::{
-    PyExecutorResourceRequests, PyResourceProfile, PyResourceProfileBuilder, 
PyTaskResourceRequests,
-};
-use crate::session::PySparkSession;
-use crate::stat::PyStatFunctions;
-use crate::streaming::{
-    PyDataStreamReader, PyDataStreamWriter, PyStreamingQuery, 
PyStreamingQueryManager,
-};
-use crate::tablearg::PyTableArg;
-use crate::tvf::PyTableValuedFunction;
-use crate::types::{
-    PyAnsiIntervalType, PyAnyTimeType, PyArrayType, PyAtomicType, 
PyBinaryType, PyBooleanType,
-    PyByteType, PyCalendarIntervalType, PyCharType, PyDataType, PyDateType, 
PyDatetimeType,
-    PyDayTimeIntervalType, PyDecimalType, PyDoubleType, PyFloatType, 
PyFractionalType,
-    PyGeographyType, PyGeometryType, PyIntegerType, PyIntegralType, 
PyLongType, PyMapType,
-    PyNullType, PyNumericType, PyShortType, PySpatialType, PyStringType, 
PyStructField,
-    PyStructType, PyTimeType, PyTimestampLTZNanosType, 
PyTimestampNTZNanosType, PyTimestampNTZType,
-    PyTimestampType, PyVarcharType, PyVariantType, PyYearMonthIntervalType,
-};
-use crate::window::PyWindowSpec;
-
-/// Where `tp_dealloc` is in CPython's `PyTypeObject`: after 
`PyObject_VAR_HEAD`, `tp_name`,
-/// `tp_basicsize` and `tp_itemsize`, as in every CPython 3. The limited API 
keeps the struct
-/// opaque, so the field is written only where it holds what `PyType_GetSlot` 
reads for it.
-const TP_DEALLOC_OFFSET: usize =
-    size_of::<ffi::PyVarObject>() + size_of::<*const c_char>() + 2 * 
size_of::<ffi::Py_ssize_t>();
-
-/// What the wrapper of a class needs, as `tp_dealloc` gets only the instance.
-struct Hook {
-    /// The `tp_dictoffset` of the class, which its Python subclasses keep.
-    dict_offset: ffi::Py_ssize_t,
-    /// PyO3's `tp_dealloc` of the class.
-    dealloc: ffi::destructor,
-}
-
-/// Wraps the `tp_dealloc` of each class with a wrapper and a hook of its own.
-macro_rules! release_dicts_of {
-    ($py:expr; $($class:ty),+ $(,)?) => {$({
-        static HOOK: OnceLock<Hook> = OnceLock::new();
-        unsafe extern "C" fn dealloc(obj: *mut ffi::PyObject) {
-            // SAFETY: CPython calls it for an instance of the class, or of a 
Python subclass.
-            unsafe { release_dict_and_dealloc(obj, &HOOK) }
-        }
-        wrap_dealloc(&$py.get_type::<$class>(), &HOOK, dealloc)?;
-    })+};
-}
-
-/// Makes the instances of the classes with a `__dict__`, the `dict` classes 
and those that
-/// extend one, release their dict when they are freed, as instances of Python 
classes do.
-pub(crate) fn release_instance_dicts(py: Python<'_>) -> PyResult<()> {
-    release_dicts_of!(py;
-        PyCatalog,
-        PyColumn,
-        PyRuntimeConf,
-        PyDataFrame,
-        PyDataFrameNaFunctions,
-        PyMergeIntoWriter,
-        PyDataFrameWriter,
-        PyDataFrameWriterV2,
-        PyDataSourceRegistration,
-        PyGroupedData,
-        PyCoGroupedData,
-        PyObservation,
-        PyDataFrameReader,
-        PyExecutorResourceRequests,
-        PyTaskResourceRequests,
-        PyResourceProfileBuilder,
-        PyResourceProfile,
-        PySparkSession,
-        PyStatFunctions,
-        PyDataStreamReader,
-        PyDataStreamWriter,
-        PyStreamingQuery,
-        PyStreamingQueryManager,
-        PyTableArg,
-        PyTableValuedFunction,
-        PyStructField,
-        PyWindowSpec,
-        // `DataType` and the classes that extend it, which keep its dict.
-        PyDataType,
-        PyAtomicType,
-        PyNumericType,
-        PyIntegralType,
-        PyFractionalType,
-        PyDatetimeType,
-        PyAnyTimeType,
-        PyAnsiIntervalType,
-        PySpatialType,
-        PyNullType,
-        PyBooleanType,
-        PyByteType,
-        PyShortType,
-        PyIntegerType,
-        PyLongType,
-        PyFloatType,
-        PyDoubleType,
-        PyDecimalType,
-        PyStringType,
-        PyBinaryType,
-        PyDateType,
-        PyTimestampType,
-        PyTimestampNTZType,
-        PyTimestampNTZNanosType,
-        PyTimestampLTZNanosType,
-        PyArrayType,
-        PyMapType,
-        PyStructType,
-        PyCharType,
-        PyVarcharType,
-        PyTimeType,
-        PyCalendarIntervalType,
-        PyYearMonthIntervalType,
-        PyDayTimeIntervalType,
-        PyVariantType,
-        PyGeometryType,
-        PyGeographyType,
-    );
-    Ok(())
-}
-
-/// Installs `wrapper` as the `tp_dealloc` of `class`, once its hook is set. A 
class without an
-/// instance dict at a fixed offset, or whose type object is not laid out as 
CPython's, is left
-/// as it is.
-fn wrap_dealloc(
-    class: &Bound<'_, PyType>,
-    hook: &'static OnceLock<Hook>,
-    wrapper: ffi::destructor,
-) -> PyResult<()> {
-    let py = class.py();
-    let dict_offset: ffi::Py_ssize_t = class.getattr(intern!(py, 
"__dictoffset__"))?.extract()?;
-    if dict_offset <= 0 || hook.get().is_some() {
-        return Ok(());
-    }
-    let ty = class.as_type_ptr();
-    // SAFETY: `ty` is a type object, pointer aligned and larger than 
`TP_DEALLOC_OFFSET` plus a
-    // pointer; the field is written only if it holds the `tp_dealloc` that 
CPython reports.
-    unsafe {
-        let dealloc = ffi::PyType_GetSlot(ty, ffi::Py_tp_dealloc);
-        if dealloc.is_null() {
-            drop(PyErr::take(py));
-            return Ok(());
-        }
-        let field = ty.cast::<u8>().add(TP_DEALLOC_OFFSET).cast::<*mut 
c_void>();
-        if field.read() != dealloc {
-            return Ok(());
-        }
-        let wrapped = Hook {
-            dict_offset,
-            dealloc: std::mem::transmute::<*mut c_void, 
ffi::destructor>(dealloc),
-        };
-        if hook.set(wrapped).is_ok() {
-            field.write(wrapper as *mut c_void);
-        }
-    }
-    Ok(())
-}
-
-/// Runs PyO3's dealloc of `obj` without its dict, which it would empty and 
keep, and then
-/// releases the dict, once the instance and its weak references are gone.
-///
-/// # Safety
-/// `obj` is an instance being freed, of the class of `hook` or of a Python 
subclass of it.
-#[inline(always)]
-unsafe fn release_dict_and_dealloc(obj: *mut ffi::PyObject, hook: 
&OnceLock<Hook>) {
-    let Some(hook) = hook.get() else {
-        // The wrapper is installed only after its hook is set.
-        std::process::abort()
-    };
-    unsafe {
-        let slot: *mut *mut ffi::PyObject = 
obj.byte_offset(hook.dict_offset).cast();
-        let dict = slot.replace(std::ptr::null_mut());
-        (hook.dealloc)(obj);
-        if !dict.is_null() {
-            ffi::Py_DECREF(dict);
-        }
-    }
-}
diff --git a/crates/pyspark-rs/src/lib.rs b/crates/pyspark-rs/src/lib.rs
index 7ec7d03b..63b4b4b4 100644
--- a/crates/pyspark-rs/src/lib.rs
+++ b/crates/pyspark-rs/src/lib.rs
@@ -19,7 +19,6 @@ mod eval_type;
 mod functions;
 mod group;
 mod infer;
-mod instance_dict;
 mod interrupt;
 mod ml;
 mod observation;
@@ -266,9 +265,5 @@ fn _pyspark(_py: Python<'_>, m: &Bound<'_, PyModule>) -> 
PyResult<()> {
     functions::register_functions(_py, &functions_module)?;
     m.add_submodule(&functions_module)?;
 
-    // The instances of the classes with a `__dict__` release it when they are 
freed, which
-    // PyO3 0.28 does not do (see `instance_dict`).
-    instance_dict::release_instance_dicts(_py)?;
-
     Ok(())
 }
diff --git a/crates/pyspark-rs/src/pyarrow_export.rs 
b/crates/pyspark-rs/src/pyarrow_export.rs
index 0a9418d0..cfad0ccf 100644
--- a/crates/pyspark-rs/src/pyarrow_export.rs
+++ b/crates/pyspark-rs/src/pyarrow_export.rs
@@ -48,13 +48,13 @@ pub(crate) fn record_batches_to_pyarrow(
         ));
     }
     if schema.fields().iter().any(|field| field_needs_ipc(field)) {
-        // Arrow 58.3 panics on NUL-containing C strings inside the C stream
-        // `get_schema` callback. Unwinding across that extern "C" boundary
-        // aborts Python instead of raising an exception. Check before export,
-        // then reuse the collected batches for IPC without another request.
-        // CString::new(...).unwrap() in FFI_ArrowSchema::try_new / with_name:
-        // 
https://github.com/apache/arrow-rs/blob/58.3.0/arrow-schema/src/ffi.rs#L148
-        // 
https://github.com/apache/arrow-rs/blob/58.3.0/arrow-schema/src/ffi.rs#L174
+        // Arrow 59.3 panics on a NUL in a timestamp time zone inside the C 
stream
+        // `get_schema` callback: the time zone is in the C format string, 
which is made with
+        // CString::new(...).unwrap(), at
+        // 
https://github.com/apache/arrow-rs/blob/59.3.2/arrow-schema/src/ffi.rs#L148.
+        // Unwinding across that extern "C" boundary aborts Python instead of 
raising an
+        // exception. Check before export, then reuse the collected batches 
for IPC without
+        // another request.
         let bytes = py
             .detach(|| -> arrow::error::Result<Vec<u8>> {
                 let mut bytes = Vec::new();
diff --git a/crates/pyspark-rs/src/row.rs b/crates/pyspark-rs/src/row.rs
index 8ec592ed..963e24d8 100644
--- a/crates/pyspark-rs/src/row.rs
+++ b/crates/pyspark-rs/src/row.rs
@@ -229,7 +229,7 @@ fn micros_timedelta(py: Python<'_>, micros: i64) -> 
PyResult<Bound<'_, PyAny>> {
     ))
 }
 
-/// Convert a Spark `Value` into a Python object (PyO3 0.28 `IntoPyObject`), 
whose binary values
+/// Convert a Spark `Value` into a Python object (PyO3's `IntoPyObject`), 
whose binary values
 /// are `bytes` if `binary_as_bytes`, or else `bytearray`, also in arrays, 
maps and structs.
 /// `nested_fields` supplies shared struct names. Call through 
`NestedFieldNames::value_at`
 /// so its schema path is set for this value and restored after conversion.
diff --git a/crates/pyspark-rs/src/values.rs b/crates/pyspark-rs/src/values.rs
index 398e9aa3..51fea111 100644
--- a/crates/pyspark-rs/src/values.rs
+++ b/crates/pyspark-rs/src/values.rs
@@ -4,9 +4,8 @@
 //! PySpark's `__init__` stores its arguments, as they are given, as the 
instance attributes
 //! `value` and `metadata`, or `wkb` and `srid`, which are writable, deletable 
and in the
 //! instance `__dict__`, and a subclass's `__init__` may set them itself. A 
value pickles as any
-//! plain class does, which the server's Python workers, of PySpark, unpickle. 
The classes are
-//! not `#[pyclass(dict)]` types, as PyO3 0.28 clears but does not release the 
`__dict__` of
-//! such an instance when it is freed, so that every value would keep a dict 
alive.
+//! plain class does, which the server's Python workers, of PySpark, unpickle. 
They are not
+//! `#[pyclass(dict)]` types, so their instances are PySpark's own.
 
 use pyo3::intern;
 use pyo3::prelude::*;
diff --git a/crates/spark-connect/src/arrow_input.rs 
b/crates/spark-connect/src/arrow_input.rs
index d44b87d0..8cfef06a 100644
--- a/crates/spark-connect/src/arrow_input.rs
+++ b/crates/spark-connect/src/arrow_input.rs
@@ -827,7 +827,7 @@ mod tests {
                 )
                 .unwrap(),
             );
-            // Arrow 58.3 accepts this through its safe constructor despite the
+            // Arrow 59.3 accepts this through its safe constructor despite the
             // declared Int64 field containing an Int32 child.
             assert!(array.to_data().validate_full().is_err());
             let batch = RecordBatch::try_new(
diff --git a/docs/installation.md b/docs/installation.md
index 06ce2b71..cef75696 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -21,7 +21,7 @@ apache-spark-connect = { version = "4.3", features = 
["datafusion", "polars"] }
 ```
 
 **Requirements:**
-- Rust 1.88 or later
+- Rust 1.88 or later (1.94 or later with the `datafusion` feature)
 - `protobuf-compiler` (e.g., `brew install protobuf` on macOS, `apt-get 
install protobuf-compiler` on Linux)
 - A running Spark Connect server (see [Configuration and 
Connection](configuration.md))
 
diff --git a/python/tests/test_dropin_offline.py 
b/python/tests/test_dropin_offline.py
index 01100dd2..83e6e9ba 100644
--- a/python/tests/test_dropin_offline.py
+++ b/python/tests/test_dropin_offline.py
@@ -8418,15 +8418,35 @@ def 
test_freed_instances_release_their_dict_as_pyspark(mock_connect):
         assert sys.getrefcount(attributes) == references - 1
 
 
+def test_cycles_through_instance_dicts_are_collected_as_pyspark(mock_connect):
+    # As PySpark's classes, plain Python classes, whose instances a reference 
cycle through their
+    # __dict__ keeps alive until the cycle is collected: a DataFrame, a 
Column, an Observation, a
+    # reader and the runtime conf of the session. PyO3 0.28 gave such a class 
no tp_traverse, so
+    # the cycle was never collected.
+    import gc
+    import weakref
+
+    from pyspark.sql import functions as F
+    from pyspark.sql.observation import Observation
+
+    spark, _ = mock_connect
+    for make in (lambda: spark.range(1), lambda: F.col("a"), lambda: 
Observation("o"),
+                 lambda: spark.read, lambda: spark.conf):
+        obj = make()
+        obj.me = obj
+        freed = weakref.ref(obj)
+        del obj
+        gc.collect()
+        assert freed() is None
+
+
 def 
test_freed_instances_given_attributes_keep_no_memory_as_pyspark(mock_connect):
     # As PySpark's classes, plain Python classes: 20,000 instances, each given 
an attribute,
     # keep next to nothing once freed (PySpark's, 32 bytes): of a Column, a 
GroupedData of the
-    # session, a DataType, a UDT (a Python subclass of DataType) and an 
Observation. PyO3 0.28
-    # kept the emptied dict of each, 64 bytes. On CPython 3.11 and 3.12, PyO3 
0.28 also loses
-    # the dict that object.__new__ makes for each instance, which only PyO3 
0.29 fixes: there,
-    # the memory that as many instances given no attribute keep is the base.
+    # session, a DataType, a UDT (a Python subclass of DataType) and an 
Observation. Instances
+    # given no attribute keep nothing either: on CPython 3.11 and 3.12 the 
dict that
+    # object.__new__ makes for each instance is released with it, which PyO3 
0.28 lost.
     import gc
-    import sys
     import tracemalloc
 
     from pyspark.sql import functions as F
@@ -8450,12 +8470,10 @@ def 
test_freed_instances_given_attributes_keep_no_memory_as_pyspark(mock_connect
         finally:
             tracemalloc.stop()
 
-    eager_dicts = sys.version_info[:2] in ((3, 11), (3, 12))
     for make in (lambda: F.col("a"), lambda: df.groupBy("id"), lambda: 
T.ArrayType(T.LongType()),
                  _DayPointUDT, lambda: Observation("o")):
         make().tag = 1  # What a first instance caches is no leak.
-        base = kept(make, False) if eager_dicts else 0
-        assert kept(make, True) - base < 20_000
+        assert kept(make, False) < 20_000 and kept(make, True) < 20_000
 
 
 def test_freed_instances_free_a_deep_chain_of_their_attributes_as_pyspark():


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to