Skip to content
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

Minor: Improve Type documentation #6224

Merged
merged 4 commits into from
Aug 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions arrow-array/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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."
alamb marked this conversation as resolved.
Show resolved Hide resolved
);
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.
Expand Down
Loading