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

TST: add extra test case for np.array(obj, copy=False) read-only behaviour #60191

Conversation

jorisvandenbossche
Copy link
Member

@jorisvandenbossche jorisvandenbossche added the Compat pandas objects compatability with Numpy or Python functions label Nov 5, 2024
@jorisvandenbossche jorisvandenbossche added this to the 3.0 milestone Nov 5, 2024
@seberg
Copy link
Contributor

seberg commented Nov 5, 2024

Looks like a good addition, nice way to avoid copy=None using both. (I am not 100% sure if there is a copy=True path for this particular case, but it LGTM either way.)

@jorisvandenbossche
Copy link
Member Author

And noticed one more case in DataFrame.__array__ where we currently were not raising an error for copy=False if that was not possible

@jorisvandenbossche
Copy link
Member Author

(I am not 100% sure if there is a copy=True path for this particular case, but it LGTM either way.)

For Series that is covered in the pandas/tests/base/test_conversion.py::test_to_numpy tests, for DataFrame will add one more case to the test I was editing anyway.

@jorisvandenbossche jorisvandenbossche modified the milestones: 3.0, 2.3 Nov 5, 2024
@jorisvandenbossche jorisvandenbossche merged commit 7fe140e into pandas-dev:main Nov 7, 2024
51 checks passed
@jorisvandenbossche jorisvandenbossche deleted the array-copy-false-extra-test branch November 7, 2024 08:57
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Nov 7, 2024
jorisvandenbossche added a commit that referenced this pull request Nov 7, 2024
…rray(obj, copy=False) read-only behaviour) (#60226)

Backport PR #60191: TST: add extra test case for np.array(obj, copy=False) read-only behaviour

Co-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Compat pandas objects compatability with Numpy or Python functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants