Skip to content

Commit

Permalink
fix: Use chrono's quarter() to avoid conflict (#7198)
Browse files Browse the repository at this point in the history
  • Loading branch information
yutannihilation authored Feb 26, 2025
1 parent b666e42 commit 2fddf85
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ arrow-select = { version = "54.2.0", path = "./arrow-select" }
arrow-string = { version = "54.2.0", path = "./arrow-string" }
parquet = { version = "54.2.0", path = "./parquet", default-features = false }

chrono = { version = "0.4.34", default-features = false, features = ["clock"] }
chrono = { version = "0.4.40", default-features = false, features = ["clock"] }
14 changes: 0 additions & 14 deletions arrow-arith/src/temporal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,12 +658,6 @@ pub(crate) use return_compute_error_with;

// Internal trait, which is used for mapping values from DateLike structures
trait ChronoDateExt {
/// Returns a value in range `1..=4` indicating the quarter this date falls into
fn quarter(&self) -> u32;

/// Returns a value in range `0..=3` indicating the quarter (zero-based) this date falls into
fn quarter0(&self) -> u32;

/// Returns the day of week; Monday is encoded as `0`, Tuesday as `1`, etc.
fn num_days_from_monday(&self) -> i32;

Expand All @@ -672,14 +666,6 @@ trait ChronoDateExt {
}

impl<T: Datelike> ChronoDateExt for T {
fn quarter(&self) -> u32 {
self.quarter0() + 1
}

fn quarter0(&self) -> u32 {
self.month0() / 3
}

fn num_days_from_monday(&self) -> i32 {
self.weekday().num_days_from_monday() as i32
}
Expand Down

0 comments on commit 2fddf85

Please sign in to comment.