Skip to content

Commit 9540c05

Browse files
authored
Bump to latest arrow, pyo3-arrow (#122)
* Bump to latest pyo3-arrow * add uv sync
1 parent 9ca258b commit 9540c05

File tree

13 files changed

+97
-76
lines changed

13 files changed

+97
-76
lines changed

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,16 @@ jobs:
5555
uses: astral-sh/setup-uv@v3
5656
with:
5757
enable-cache: true
58-
version: "0.4.x"
58+
version: "0.5.x"
59+
60+
- name: uv sync
61+
working-directory: python
62+
run: uv sync --no-install-package geoindex-rs
5963

6064
- name: maturin venv Build
6165
working-directory: python
62-
run: uv run maturin develop
66+
run: uv run --no-project maturin develop
6367

6468
- name: Run pytest
6569
working-directory: python
66-
run: uv run pytest
70+
run: uv run --no-project pytest

python/Cargo.lock

Lines changed: 44 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ name = "_rust"
1717
crate-type = ["cdylib"]
1818

1919
[dependencies]
20-
arrow-array = "53.0.0"
21-
arrow-buffer = "53.0.0"
22-
arrow-cast = "53.0.0"
23-
arrow-schema = "53.0.0"
20+
arrow-array = "54.0.0"
21+
arrow-buffer = "54.0.0"
22+
arrow-cast = "54.0.0"
23+
arrow-schema = "54.0.0"
2424
bytemuck = "1.21.0"
2525
bytes = "1.8"
2626
geo-index = { path = "../", features = ["rayon"] }
2727
numpy = "0.23"
28-
pyo3 = { version = "0.23.0", features = ["macros"] }
28+
pyo3 = { version = "0.23.4", features = ["macros"] }
2929
thiserror = "1"
30-
pyo3-arrow = "0.6.0"
30+
pyo3-arrow = "0.7.0"
3131

3232
[profile.release]
3333
lto = true

python/src/kdtree/builder.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl PyKDTreeBuilder {
7474
}
7575
let mut out_array = UInt32Builder::with_capacity(x_array.len());
7676

77-
let inner = self.0.as_mut().take().unwrap();
77+
let inner = self.0.as_mut().unwrap();
7878

7979
match (x_field.data_type(), y) {
8080
(DataType::FixedSizeList(_inner_field, list_size), y) => {
@@ -172,7 +172,9 @@ impl PyKDTreeBuilder {
172172
_ => return Err(PyValueError::new_err("Unsupported argument types")),
173173
};
174174

175-
PyArray::from_array_ref(Arc::new(out_array.finish())).to_arro3(py)
175+
Ok(PyArray::from_array_ref(Arc::new(out_array.finish()))
176+
.to_arro3(py)?
177+
.unbind())
176178
}
177179

178180
fn finish(&mut self) -> PyResult<PyKDTree> {

python/src/kdtree/range.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,7 @@ pub fn range(
3232
),
3333
};
3434
let results = UInt32Array::new(ScalarBuffer::from(results), None);
35-
PyArray::from_array_ref(Arc::new(results)).to_arro3(py)
35+
Ok(PyArray::from_array_ref(Arc::new(results))
36+
.to_arro3(py)?
37+
.unbind())
3638
}

python/src/kdtree/within.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,7 @@ pub fn within(
2121
PyKDTreeRef::Float64(tree) => tree.within(qx.extract()?, qy.extract()?, r.extract()?),
2222
};
2323
let results = UInt32Array::new(ScalarBuffer::from(results), None);
24-
PyArray::from_array_ref(Arc::new(results)).to_arro3(py)
24+
Ok(PyArray::from_array_ref(Arc::new(results))
25+
.to_arro3(py)?
26+
.unbind())
2527
}

python/src/rtree/boxes_at_level.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ pub fn boxes_at_level(
2929
boxes_to_arrow::<Float64Type>(boxes, tree.buffer().clone(), copy)
3030
}
3131
};
32-
PyArray::from_array_ref(array).to_arro3(py)
32+
Ok(PyArray::from_array_ref(array).to_arro3(py)?.unbind())
3333
}

0 commit comments

Comments
 (0)