Arrow 55 not building with other versions of Arrow
- Dominant language
- Rust
- Stars
- 3.6k
- Forks
- 1.3k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 169
Description
**Describe the bug**
When your crate has multiple versions of Arrow (for example, to allow FFI between various versions of Arrow and Polars like this [crate](https://github.com/EricFecteau/df-interchange)), Arrow 55 throws an error. Arrow 50, 51, 52, 53, 54 can be placed in the same crate, arrow 54 and 55 also work together, but you can't have 55 with any of the ones prior to 54. It throws this error:
```
error[E0034]: multiple applicable items in scope
--> /home/eric/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-arith-53.4.0/src/temporal.rs:91:36
|
91 | DatePart::Quarter => |d| d.quarter() as i32,
| ^^^^^^^ multiple `quarter` found
|
note: candidate #1 is defined in the trait `ChronoDateExt`
--> /home/eric/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-arith-53.4.0/src/temporal.rs:637:5
|
637 | fn quarter(&self) -> u32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `Datelike`
--> /home/eric/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/chrono-0.4.40/src/traits.rs:47:5
|
47 | fn quarter(&self) -> u32 {
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
|
91 - DatePart::Quarter => |d| d.quarter() as i32,
91 + DatePart::Quarter => |d| ChronoDateExt::quarter(&d) as i32,
|
help: disambiguate the method for candidate #2
|
91 - DatePart::Quarter => |d| d.quarter() as i32,
91 + DatePart::Quarter => |d| Datelike::quarter(&d) as i32,
|
For more information about this error, try `rustc --explain E0034`.
error: could not compile `arrow-arith` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
```
**To Reproduce**
You can recreate by creating a new crate with these dependencies in the `Cargo.toml` and running `cargo build`.
```toml
[dependencies]
arrow_53 = { package = "arrow", version = "53"}
arrow_54 = { package = "arrow", version = "54"}
arrow_55 = { package = "arrow", version = "55"}
```
**Expected behavior**
Expected that multiple versions of Arrow should be able to be placed in the same crate.
**Additional context**
Not all crates update at the same rate and having an ability to convert some Arrow 53 data into Arrow 55 data (with FFI) is useful for an integrated ecosystem.
Contributor guide
Research direction
Reproduce the failure with the three Arrow dependencies in Cargo.toml, then inspect arrow-arith-53.4.0/src/temporal.rs around line 91 and the reported quarter method definitions. Run cargo build to confirm the conflict and verify that the dependency combination compiles without the multiple-applicable-items error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system, data-engineering
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100