Skip to content

Commit

Permalink
Revert Copy change to support previous Arrow versions
Browse files Browse the repository at this point in the history
  • Loading branch information
chmp committed Sep 11, 2024
1 parent 5688bdb commit e5ee1e1
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions serde_arrow/src/arrow_impl/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,27 @@ impl TryFrom<&ArrowDataType> for DataType {
AT::Date32 => Ok(T::Date32),
AT::Date64 => Ok(T::Date64),
AT::Decimal128(precision, scale) => Ok(T::Decimal128(*precision, *scale)),
AT::Time32(unit) => Ok(T::Time32((*unit).into())),
AT::Time64(unit) => Ok(T::Time64((*unit).into())),
AT::Time32(unit) => Ok(T::Time32(
// only some arrow version implement Copy for unit
#[allow(clippy::clone_on_copy)]
unit.clone().into(),
)),
AT::Time64(unit) => Ok(T::Time64(
// only some arrow version implement Copy for unit
#[allow(clippy::clone_on_copy)]
unit.clone().into(),
)),
AT::Timestamp(unit, tz) => Ok(T::Timestamp(
(*unit).into(),
// only some arrow version implement Copy for unit
#[allow(clippy::clone_on_copy)]
unit.clone().into(),
tz.as_ref().map(|s| s.to_string()),
)),
AT::Duration(unit) => Ok(T::Duration((*unit).into())),
AT::Duration(unit) => Ok(T::Duration(
// only some arrow version implement Copy for unit
#[allow(clippy::clone_on_copy)]
unit.clone().into(),
)),
AT::Binary => Ok(T::Binary),
AT::LargeBinary => Ok(T::LargeBinary),
AT::FixedSizeBinary(n) => Ok(T::FixedSizeBinary(*n)),
Expand Down

0 comments on commit e5ee1e1

Please sign in to comment.