Skip to content

Conversation

@mbrobbel
Copy link
Member

@mbrobbel mbrobbel commented Sep 5, 2025

Which issue does this PR close?

Rationale for this change

Bumping to the latest pyo3.

What changes are included in this PR?

Handle breaking changes.

Are these changes tested?

CI.

Are there any user-facing changes?

Yes.

@mbrobbel mbrobbel added api-change Changes to the arrow API next-major-release the PR has API changes and it waiting on the next major version labels Sep 5, 2025
/// Returns `array + array` of an int64 array.
#[pyfunction]
fn double(array: &Bound<PyAny>, py: Python) -> PyResult<PyObject> {
fn double(array: &Bound<PyAny>, py: Python) -> PyResult<Py<PyAny>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may make sense to change the return type of the to_pyarrow functions to Bound<PyAny> instead of Py<PyAny>? Then you wouldn't need to carry around a py: Python token in any of these functions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 5218810 what you had in mind?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Looks great!

@mbrobbel mbrobbel added this to the 57.0.0 milestone Sep 15, 2025
@mbrobbel mbrobbel merged commit 07cb7f0 into apache:main Sep 23, 2025
14 checks passed
@mbrobbel mbrobbel deleted the pyo3-0.26 branch September 23, 2025 16:32
@alamb alamb mentioned this pull request Sep 23, 2025
alamb added a commit that referenced this pull request Sep 23, 2025
# Which issue does this PR close?
- related to #8286


# Rationale for this change
Ci is failing on main after this PR is merged
- #8286

<img width="1464" height="714" alt="Screenshot 2025-09-23 at 2 22 46 PM"
src="https://github.com/user-attachments/assets/83725d32-baac-48a7-b6e8-3620ae3cde98"
/>


Here is an example failure:
https://github.com/apache/arrow-rs/actions/runs/17952764906/job/51056301800
```
error: useless conversion to the same type: `pyo3::Bound<'_, pyo3::PyAny>`
   --> arrow-pyarrow/src/lib.rs:181:12
    |
181 |         Ok(dtype.into())
    |            ^^^^^^^^^^^^ help: consider removing `.into()`: `dtype`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
    = note: `-D clippy::useless-conversion` implied by `-D warnings`
    = help: to override `-D warnings` add `#[allow(clippy::useless_conversion)]`

error: useless conversion to the same type: `pyo3::Bound<'_, pyo3::PyAny>`
   --> arrow-pyarrow/src/lib.rs:217:12
    |
217 |         Ok(dtype.into())
    |            ^^^^^^^^^^^^ help: consider removing `.into()`: `dtype`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

error: useless conversion to the same type: `pyo3::Bound<'_, pyo3::PyAny>`
   --> arrow-pyarrow/src/lib.rs:253:12
    |
253 |         Ok(schema.into())
    |            ^^^^^^^^^^^^^ help: consider removing `.into()`: `schema`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion

error: could not compile `arrow-pyarrow` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...
```

I think it is a logical conflict

# What changes are included in this PR?

Fix clippy

# Are these changes tested?

We typically require tests for all PRs in order to:
1. Prevent the code from being accidentally broken by subsequent changes
2. Serve as another way to document the expected behavior of the code

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?

# Are there any user-facing changes?

If there are user-facing changes then we may require documentation to be
updated before approving the PR.

If there are any breaking changes to public APIs, please call them out.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-change Changes to the arrow API next-major-release the PR has API changes and it waiting on the next major version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants