From b60c55301346647585c5232021c869ee8f8241b4 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Sun, 11 Aug 2024 07:42:07 -0400 Subject: [PATCH 1/2] Minor: Improve XXXType documentation --- arrow-array/src/types.rs | 56 +++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index 86298cf3e729..c934a82a3c5c 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -101,163 +101,165 @@ make_type!( Int16Type, i16, DataType::Int16, - "A signed 16-bit integer type." + "Signed 16-bit integer type." ); make_type!( Int32Type, i32, DataType::Int32, - "A signed 32-bit integer type." + "Signed 32-bit integer type." ); make_type!( Int64Type, i64, DataType::Int64, - "A signed 64-bit integer type." + "Signed 64-bit integer type." ); make_type!( UInt8Type, u8, DataType::UInt8, - "An unsigned 8-bit integer type." + "Unsigned 8-bit integer type." ); make_type!( UInt16Type, u16, DataType::UInt16, - "An unsigned 16-bit integer type." + "Unsigned 16-bit integer type." ); make_type!( UInt32Type, u32, DataType::UInt32, - "An unsigned 32-bit integer type." + "Unsigned 32-bit integer type." ); make_type!( UInt64Type, u64, DataType::UInt64, - "An unsigned 64-bit integer type." + "Unsigned 64-bit integer type." ); make_type!( Float16Type, f16, DataType::Float16, - "A 16-bit floating point number type." + "16-bit floating point number type." ); make_type!( Float32Type, f32, DataType::Float32, - "A 32-bit floating point number type." + "32-bit floating point number type." ); make_type!( Float64Type, f64, DataType::Float64, - "A 64-bit floating point number type." + "64-bit floating point number type." ); make_type!( TimestampSecondType, i64, DataType::Timestamp(TimeUnit::Second, None), - "A timestamp second type with an optional timezone." + "Timestamp second type with an optional timezone." ); make_type!( TimestampMillisecondType, i64, DataType::Timestamp(TimeUnit::Millisecond, None), - "A timestamp millisecond type with an optional timezone." + "Timestamp millisecond type with an optional timezone." ); make_type!( TimestampMicrosecondType, i64, DataType::Timestamp(TimeUnit::Microsecond, None), - "A timestamp microsecond type with an optional timezone." + "Timestamp microsecond type with an optional timezone." ); make_type!( TimestampNanosecondType, i64, DataType::Timestamp(TimeUnit::Nanosecond, None), - "A timestamp nanosecond type with an optional timezone." + "Timestamp nanosecond type with an optional timezone." ); make_type!( Date32Type, i32, DataType::Date32, - "A 32-bit date type representing the elapsed time since UNIX epoch in days(32 bits)." + "32-bit date type: the elapsed time since UNIX epoch in days (32 bits)." ); make_type!( Date64Type, i64, DataType::Date64, - "A 64-bit date type representing the elapsed time since UNIX epoch in milliseconds(64 bits)." + "64-bit date type: the elapsed time since UNIX epoch in milliseconds (64 bits). \ + Values must be divisible by `86_400_000`. \ + See [DataType::Date64] for more details." ); make_type!( Time32SecondType, i32, DataType::Time32(TimeUnit::Second), - "A 32-bit time type representing the elapsed time since midnight in seconds." + "32-bit time type: the elapsed time since midnight in seconds." ); make_type!( Time32MillisecondType, i32, DataType::Time32(TimeUnit::Millisecond), - "A 32-bit time type representing the elapsed time since midnight in milliseconds." + "32-bit time type: the elapsed time since midnight in milliseconds." ); make_type!( Time64MicrosecondType, i64, DataType::Time64(TimeUnit::Microsecond), - "A 64-bit time type representing the elapsed time since midnight in microseconds." + "64-bit time type: the elapsed time since midnight in microseconds." ); make_type!( Time64NanosecondType, i64, DataType::Time64(TimeUnit::Nanosecond), - "A 64-bit time type representing the elapsed time since midnight in nanoseconds." + "64-bit time type: the elapsed time since midnight in nanoseconds." ); make_type!( IntervalYearMonthType, i32, DataType::Interval(IntervalUnit::YearMonth), - "A 32-bit “calendar” interval type representing the number of whole months." + "32-bit “calendar” interval type: the number of whole months." ); make_type!( IntervalDayTimeType, IntervalDayTime, DataType::Interval(IntervalUnit::DayTime), - "A “calendar” interval type representing days and milliseconds. See [`IntervalDayTime`] for more details." + "“Calendar” interval type: days and milliseconds. See [`IntervalDayTime`] for more details." ); make_type!( IntervalMonthDayNanoType, IntervalMonthDayNano, DataType::Interval(IntervalUnit::MonthDayNano), - r"A “calendar” interval type representing months, days, and nanoseconds. See [`IntervalMonthDayNano`] for more details." + r"“Calendar” interval type: months, days, and nanoseconds. See [`IntervalMonthDayNano`] for more details." ); make_type!( DurationSecondType, i64, DataType::Duration(TimeUnit::Second), - "An elapsed time type in seconds." + "Elapsed time type: seconds." ); make_type!( DurationMillisecondType, i64, DataType::Duration(TimeUnit::Millisecond), - "An elapsed time type in milliseconds." + "Elapsed time type: milliseconds." ); make_type!( DurationMicrosecondType, i64, DataType::Duration(TimeUnit::Microsecond), - "An elapsed time type in microseconds." + "Elapsed time type: microseconds." ); make_type!( DurationNanosecondType, i64, DataType::Duration(TimeUnit::Nanosecond), - "An elapsed time type in nanoseconds." + "Elapsed time type: nanoseconds." ); /// A subtype of primitive type that represents legal dictionary keys. From 2ea8c91e1507a3924170b7e3be29a333baf4a2c7 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Tue, 13 Aug 2024 11:58:52 -0400 Subject: [PATCH 2/2] Update arrow-array/src/types.rs Co-authored-by: Marco Neumann --- arrow-array/src/types.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arrow-array/src/types.rs b/arrow-array/src/types.rs index c934a82a3c5c..550d1aadf3fa 100644 --- a/arrow-array/src/types.rs +++ b/arrow-array/src/types.rs @@ -193,7 +193,7 @@ make_type!( DataType::Date64, "64-bit date type: the elapsed time since UNIX epoch in milliseconds (64 bits). \ Values must be divisible by `86_400_000`. \ - See [DataType::Date64] for more details." + See [`DataType::Date64`] for more details." ); make_type!( Time32SecondType,