Skip to content

Commit

Permalink
REname is_int_type to is_dictionary_key_type()
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed Nov 4, 2021
1 parent 5c8da87 commit 8acd8d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arrow/src/array/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ impl ArrayData {
}
DataType::Dictionary(key_type, _value_type) => {
// At the moment, constructing a DictionaryArray will also check this
if !DataType::is_integer(key_type) {
if !DataType::is_dictionary_key_type(key_type) {
return Err(ArrowError::InvalidArgumentError(format!(
"Dictionary values must be integer, but was {}",
key_type
Expand Down
5 changes: 3 additions & 2 deletions arrow/src/datatypes/datatype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,9 @@ impl DataType {
)
}

/// Returns true if this type is integral: (UInt*, Unit*).
pub fn is_integer(t: &DataType) -> bool {
/// Returns true if this type is valid as a dictionary key
/// (e.g. [`super::ArrowDictionaryKeyType`]
pub fn is_dictionary_key_type(t: &DataType) -> bool {
use DataType::*;
matches!(
t,
Expand Down

0 comments on commit 8acd8d2

Please sign in to comment.