Skip to content

ChronoDateExt::quarter() conflicts with chrono v0.4.40 #7196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
yutannihilation opened this issue Feb 26, 2025 · 5 comments · Fixed by #7198 or ArroyoSystems/arroyo#839
Closed

ChronoDateExt::quarter() conflicts with chrono v0.4.40 #7196

yutannihilation opened this issue Feb 26, 2025 · 5 comments · Fixed by #7198 or ArroyoSystems/arroyo#839
Labels

Comments

@yutannihilation
Copy link
Contributor

Describe the bug

chrono v0.4.40, which was released just a few hours ago, provides its own .quarter() method.

pull request: chronotope/chrono#1666

So, this now conflicts with the arrow's implementation.

error[E0034]: multiple applicable items in scope
   --> /Users/yutannihilation/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-arith-54.2.0/src/temporal.rs:92:36
    |
92  |         DatePart::Quarter => |d| d.quarter() as i32,
    |                                    ^^^^^^^ multiple `quarter` found
    |
note: candidate #1 is defined in the trait `ChronoDateExt`
   --> /Users/yutannihilation/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-arith-54.2.0/src/temporal.rs:638:5
    |
638 |     fn quarter(&self) -> u32;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `Datelike`
   --> /Users/yutannihilation/.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
    |
92  |         DatePart::Quarter => |d| ChronoDateExt::quarter(&d) as i32,
    |                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
    |
92  |         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

To Reproduce

cargo update chrono
cargo build

Expected behavior

Additional context

@ddimaria
Copy link

This issue is blocking our builds. I saw there was a fix applied in #7198, does anyone know when this will be released?

@tustvold
Copy link
Contributor

Unfortunately chrono released a breaking change in a patch release, whilst #7198 updates to accomodate this breaking change, downstreams will need to pin to chrono v0.4.39 either using a lockfile or an explicit dependency

@haixuanTao
Copy link
Contributor

haixuanTao commented Feb 26, 2025

For a hot quick fix, this should work:

arrow = { git = "https://github.com/apache/arrow-rs" }
arrow-schema = { git = "https://github.com/apache/arrow-rs" }
arrow-data = { git = "https://github.com/apache/arrow-rs" }
arrow-array = { git = "https://github.com/apache/arrow-rs" }

But, this is just for currently build on git.

I wonder if this issue makes old version of arrrow by default unusable, as well as all package like mine dependant on arrow.

@tustvold
Copy link
Contributor

tustvold commented Feb 26, 2025

For a hot quick fix, this should work:

A simpler option would be

chrono = "= 0.4.39"

Anywhere in the workspace

I wonder if this issue makes old version of arrrow by default unusable, as well as all package like mine dependant on arrow.

They'll work fine provided something, e.g. lockfile or constraint, encourages cargo to not use 0.4.40

jacobtrombetta added a commit to spaceandtimefdn/sxt-proof-of-sql that referenced this issue Feb 27, 2025
# Rationale for this change
chrono `v0.4.40` implemented a `quarter` method that causes build errors
when building with arrow. See bug
apache/arrow-rs#7196 and this commit
apache/arrow-rs#7210. The suggested workaround
is to pin chrono to `v0.4.39`.

# What changes are included in this PR?
- Pins chrono to the latest version that works with arrow, `v0.4.39`

# Are these changes tested?
Yes
@tustvold tustvold marked this as a duplicate of #7205 Feb 27, 2025
@DataBora
Copy link

I needed to downgrade DataFusion from 44.0.0 to 43.0.0, arrow to =53.2.0, and chrono to =0.4.38 , in order for Elusion crate to build. I had consideration for ODBC as well, so thats why chrono is on 0.4.38

pka added a commit to pka/owntrack-rs that referenced this issue Feb 28, 2025
Fixes apache/arrow-rs#7196 but breaks
build with bundled duckdb (duckdb/duckdb-rs#436)
haixuanTao added a commit to dora-rs/dora that referenced this issue Mar 2, 2025
Pin chrono version to fix CI/CD bug related to:
apache/arrow-rs#7196 (comment)
quodlibetor added a commit to quodlibetor/testcontainers-rs-modules-community that referenced this issue Mar 2, 2025
arrow-arith bug report: apache/arrow-rs#7196

You don't want to actually restrict the Chrono version since your deps
need to choose their own workaround, but this will hopefully fix CI.
quodlibetor added a commit to quodlibetor/testcontainers-rs-modules-community that referenced this issue Mar 2, 2025
arrow-arith bug report: apache/arrow-rs#7196

You don't want to actually restrict the Chrono version since your deps
need to choose their own workaround, but this will hopefully fix CI.
DDtKey pushed a commit to testcontainers/testcontainers-rs-modules-community that referenced this issue Mar 2, 2025
…on failure (#304)

arrow-arith bug report: apache/arrow-rs#7196

You don't want to actually restrict the Chrono version since your deps
need to choose their own workaround, but this will hopefully fix CI.
JayWhite2357 pushed a commit to spaceandtimefdn/sxt-proof-of-sql that referenced this issue Mar 7, 2025
# Rationale for this change
chrono `v0.4.40` implemented a `quarter` method that causes build errors
when building with arrow. See bug
apache/arrow-rs#7196 and this commit
apache/arrow-rs#7210. The suggested workaround
is to pin chrono to `v0.4.39`.

# What changes are included in this PR?
- Pins chrono to the latest version that works with arrow, `v0.4.39`

# Are these changes tested?
Yes
carols10cents added a commit to influxdata/influxdb3_core that referenced this issue May 15, 2025
carols10cents added a commit to influxdata/influxdb3_core that referenced this issue May 16, 2025
carols10cents added a commit to influxdata/influxdb3_core that referenced this issue May 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants