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

ARROW-17620: [R] as_arrow_array() ignores type for StructArrays #14047

Merged
merged 4 commits into from
Sep 12, 2022

Conversation

fmichonneau
Copy link
Contributor

As described in https://issues.apache.org/jira/browse/ARROW-17620, as_arrow_array() ignores user-provided types passed by the type argument.

This PR explicitly adds the type name argument to the Map call. Currently, the argument gets passed to the ellipsis and gets ignored.

I also added a test. Let me know if there is a better place for it (or a better test).

@github-actions
Copy link

github-actions bot commented Sep 5, 2022

@github-actions
Copy link

github-actions bot commented Sep 5, 2022

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@fmichonneau
Copy link
Contributor Author

With this fix, 2 tests were failing. Previously, the type argument was ignored, making the tests pass even though the tests were using the incorrect dataset. 07e75eb fixes that.

Copy link
Member

@thisisnic thisisnic left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this! One small suggestion, otherwise looking good.

Comment on lines 535 to 536
## as_arrow_array respects `type` argument (ARROW-17620)
expect_type_equal(a, as_arrow_array(df, type = type))
Copy link
Member

Choose a reason for hiding this comment

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

As we have a few other tests for the functionality of as_arrow_array(), and this is testing one of the function's arguments, I think it's significant enough to live in its own test_that() block. Would you mind making that change, and moving it down (I think those tests start near line 1021 of this file)?

@fmichonneau
Copy link
Contributor Author

Thanks @thisisnic! I moved the test to its own block. Let me know if you need anything else.

Copy link
Member

@thisisnic thisisnic left a comment

Choose a reason for hiding this comment

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

Great; thanks!

@thisisnic thisisnic merged commit 3ddf69e into apache:master Sep 12, 2022
@fmichonneau fmichonneau deleted the ARROW-17620 branch September 12, 2022 13:33
@ursabot
Copy link

ursabot commented Sep 12, 2022

Benchmark runs are scheduled for baseline = 8c76855 and contender = 3ddf69e. 3ddf69e is a master commit associated with this PR. Results will be available as each benchmark for each run completes.
Conbench compare runs links:
[Finished ⬇️0.0% ⬆️0.0%] ec2-t3-xlarge-us-east-2
[Finished ⬇️0.51% ⬆️0.0%] test-mac-arm
[Failed ⬇️0.0% ⬆️0.56%] ursa-i9-9960x
[Finished ⬇️0.14% ⬆️0.0%] ursa-thinkcentre-m75q
Buildkite builds:
[Finished] 3ddf69e1 ec2-t3-xlarge-us-east-2
[Finished] 3ddf69e1 test-mac-arm
[Failed] 3ddf69e1 ursa-i9-9960x
[Finished] 3ddf69e1 ursa-thinkcentre-m75q
[Finished] 8c76855b ec2-t3-xlarge-us-east-2
[Finished] 8c76855b test-mac-arm
[Failed] 8c76855b ursa-i9-9960x
[Finished] 8c76855b ursa-thinkcentre-m75q
Supported benchmarks:
ec2-t3-xlarge-us-east-2: Supported benchmark langs: Python, R. Runs only benchmarks with cloud = True
test-mac-arm: Supported benchmark langs: C++, Python, R
ursa-i9-9960x: Supported benchmark langs: Python, R, JavaScript
ursa-thinkcentre-m75q: Supported benchmark langs: C++, Java

zagto pushed a commit to zagto/arrow that referenced this pull request Oct 7, 2022
…he#14047)

As described in https://issues.apache.org/jira/browse/ARROW-17620, `as_arrow_array()` ignores user-provided types passed by the `type` argument.

This PR explicitly adds the `type` name argument to the `Map` call. Currently, the argument gets passed to the ellipsis and gets ignored.

I also added a test. Let me know if there is a better place for it (or a better test).

Lead-authored-by: François Michonneau <[email protected]>
Co-authored-by: Nic Crane <[email protected]>
Signed-off-by: Nic Crane <[email protected]>
fatemehp pushed a commit to fatemehp/arrow that referenced this pull request Oct 17, 2022
…he#14047)

As described in https://issues.apache.org/jira/browse/ARROW-17620, `as_arrow_array()` ignores user-provided types passed by the `type` argument.

This PR explicitly adds the `type` name argument to the `Map` call. Currently, the argument gets passed to the ellipsis and gets ignored.

I also added a test. Let me know if there is a better place for it (or a better test).

Lead-authored-by: François Michonneau <[email protected]>
Co-authored-by: Nic Crane <[email protected]>
Signed-off-by: Nic Crane <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants