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

Restrict DictionaryArray to ArrowDictionaryKeyType #3813

Merged
merged 2 commits into from
Mar 7, 2023

Conversation

tustvold
Copy link
Contributor

@tustvold tustvold commented Mar 7, 2023

Which issue does this PR close?

Part of #1799

Rationale for this change

DictionaryArray should only be constructible for valid dictionary indexes, this is strictly enforced by the move to structured ArrayData, and so we need to enforce this strictly for the array type also.

What changes are included in this PR?

A few call-sites, including the DictionaryArray definition weren't restricted to ArrowDictionaryKeyType, they now are

Are there any user-facing changes?

@tustvold tustvold added the api-change Changes to the arrow API label Mar 7, 2023
@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 7, 2023
@@ -955,14 +955,6 @@ mod tests {
DictionaryArray::<Int32Type>::try_new(&keys, &values).unwrap();
}

#[test]
#[should_panic(expected = "Dictionary key type must be integer, but was Float32")]
fn test_try_wrong_dictionary_key_type() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This now results in a compilation error

@tustvold tustvold merged commit 6678b23 into apache:master Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants