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

fix: Update copy param on to_numpy to default to True for cuDF #937

Merged
merged 2 commits into from
Sep 10, 2024

Conversation

LiamConnors
Copy link
Member

@LiamConnors LiamConnors commented Sep 10, 2024

What type of PR is this? (check all applicable)

  • πŸ’Ύ Refactor
  • ✨ Feature
  • πŸ› Bug Fix
  • πŸ”§ Optimization
  • πŸ“ Documentation
  • βœ… Test
  • 🐳 Other

Related issues

  • Related issue #862
  • Closes #

Checklist

  • Code follows style guide (ruff)
  • Tests added
  • Documented the changes

If you have comments or can explain your changes, please do so below.

This PR fixes issue seen in tests:
ValueError: copy=False is not supported because conversion to a numpy array always copies the data.

And reduces the number of failing tests by 7.

@MarcoGorelli the cuDF docs show copy defaults to True on cuDF. So I think that it should set copy=True here when it's None for cuDF. What do you think - Is that the right approach?

https://docs.rapids.ai/api/cudf/stable/user_guide/api_docs/api/cudf.series.to_numpy/
https://docs.rapids.ai/api/cudf/stable/user_guide/api_docs/api/cudf.dataframe.to_numpy/

@github-actions github-actions bot added the fix label Sep 10, 2024
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

thanks @LiamConnors !

agree - we don't expose copy in to_numpy anyway (https://narwhals-dev.github.io/narwhals/api-reference/series/#narwhals.series.Series.to_numpy) so πŸ‘ to just use the library's default

@MarcoGorelli MarcoGorelli merged commit be95f2e into narwhals-dev:main Sep 10, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants