Skip to content

BUG: segfault for null dtype in to_numpy #52466

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

Merged
merged 7 commits into from
Apr 6, 2023
Merged

BUG: segfault for null dtype in to_numpy #52466

merged 7 commits into from
Apr 6, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Apr 5, 2023

@@ -1676,6 +1677,15 @@ def test_to_numpy_int_with_na():
tm.assert_numpy_array_equal(result, expected)


@pytest.mark.parametrize("na_val, exp", [(lib.no_default, np.nan), (1, 1)])
def test_to_numpy_null_array(na_val, exp):
Copy link
Member

Choose a reason for hiding this comment

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

Could you also test the dtype=None, na_value=lib.no_default case?

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@mroeschke mroeschke added Dtype Conversions Unexpected or buggy dtype conversions Arrow pyarrow functionality labels Apr 5, 2023
@mroeschke mroeschke added this to the 2.0.1 milestone Apr 5, 2023
@phofl phofl merged commit 7974ad0 into pandas-dev:main Apr 6, 2023
@lumberbot-app
Copy link

lumberbot-app bot commented Apr 6, 2023

Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

  1. Checkout backport branch and update it.
git checkout 2.0.x
git pull
  1. Cherry pick the first parent branch of the this PR on top of the older branch:
git cherry-pick -x -m1 7974ad0ba191e0a6b6bda5e0beb9669d0391b5af
  1. You will likely have some merge/cherry-pick conflict here, fix them and commit:
git commit -am 'Backport PR #52466: BUG: segfault for null dtype in to_numpy'
  1. Push to a named branch:
git push YOURFORK 2.0.x:auto-backport-of-pr-52466-on-2.0.x
  1. Create a PR against branch 2.0.x, I would have named this PR:

"Backport PR #52466 on branch 2.0.x (BUG: segfault for null dtype in to_numpy)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the Still Needs Manual Backport label once the PR gets merged.

If these instructions are inaccurate, feel free to suggest an improvement.

topper-123 pushed a commit to topper-123/pandas that referenced this pull request Apr 6, 2023
phofl added a commit to phofl/pandas that referenced this pull request Apr 6, 2023
mroeschke added a commit that referenced this pull request Apr 7, 2023
…o_numpy) (#52497)

* BUG: segfault for null dtype in to_numpy (#52466)

(cherry picked from commit 7974ad0)

* Update pandas/core/arrays/arrow/array.py

* Update pandas/core/arrays/arrow/array.py

---------

Co-authored-by: Matthew Roeschke <[email protected]>
@phofl phofl deleted the 52443 branch August 28, 2023 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow pyarrow functionality Dtype Conversions Unexpected or buggy dtype conversions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: astype does not handle conversion of null[pyarrow]
2 participants