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: use as_boolean to resolve TODO #4367

Merged
merged 1 commit into from
Jun 6, 2023
Merged

Conversation

jackwener
Copy link
Member

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jun 5, 2023
@jackwener jackwener changed the title Use take_boolean to remove useless TODO minor: use take_boolean to remove useless TODO Jun 5, 2023
@@ -476,7 +476,7 @@ where
}

/// `take` implementation for boolean arrays
fn take_boolean<IndexType>(
pub fn take_boolean<IndexType>(
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure about this, we currently don't expose these both to keep the API surface down

@@ -1196,8 +1196,7 @@ where
K: ArrowDictionaryKeyType,
K::Native: num::ToPrimitive,
{
// TODO: Use take_boolean (#2967)
let array = take(&dict_comparison, dict.keys(), None)?;
let array = take_boolean(&dict_comparison, dict.keys())?;
Copy link
Contributor

@tustvold tustvold Jun 5, 2023

Choose a reason for hiding this comment

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

Suggested change
let array = take_boolean(&dict_comparison, dict.keys())?;
let array = take(&dict_comparison, dict.keys())?.as_boolean().clone();

Perhaps? The overhead of the dyn dispatch and clone is irrelevant in the grand scheme of things. The linked issue #2967 was closed as not planned

@jackwener
Copy link
Member Author

Thanks @tustvold review

@tustvold tustvold changed the title minor: use take_boolean to remove useless TODO minor: use as_boolean to resolve TODO Jun 6, 2023
@tustvold tustvold merged commit 077058d into apache:master Jun 6, 2023
@jackwener jackwener deleted the take branch June 6, 2023 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants