Skip to content

Commit

Permalink
*: polish the error
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Mar 22, 2022
1 parent a16ce31 commit c661156
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion arrow/src/array/array_dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ mod tests {
}

#[test]
#[should_panic(expected = "Dictionary values must be integer, but was Float32")]
#[should_panic(expected = "Dictionary key type must be integer, but was Float32")]
fn test_try_wrong_dictionary_key_type() {
let values: StringArray = [Some("foo"), Some("bar")].into_iter().collect();
let keys: Float32Array = [Some(0_f32), None, Some(3_f32)].into_iter().collect();
Expand Down
4 changes: 2 additions & 2 deletions arrow/src/array/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ impl ArrayData {
// At the moment, constructing a DictionaryArray will also check this
if !DataType::is_dictionary_key_type(key_type) {
return Err(ArrowError::InvalidArgumentError(format!(
"Dictionary values must be integer, but was {}",
"Dictionary key type must be integer, but was {}",
key_type
)));
}
Expand Down Expand Up @@ -1736,7 +1736,7 @@ mod tests {

// Test creating a dictionary with a non integer type
#[test]
#[should_panic(expected = "Dictionary values must be integer, but was Utf8")]
#[should_panic(expected = "Dictionary key type must be integer, but was Utf8")]
fn test_non_int_dictionary() {
let i32_buffer = Buffer::from_slice_ref(&[0i32, 2i32]);
let data_type =
Expand Down

0 comments on commit c661156

Please sign in to comment.