Skip to content

[Python] Conversion to/from numpy 2.0+ new StringDType #42018

Open
1 of 1 issue completed
Open

Description

@jorisvandenbossche

With the upcoming numpy 2.0 release, they introduce a new variable-length string dtype, StringDType (https://numpy.org/devdocs/release/2.0.0-notes.html#highlights).

Currently trying to convert that obviously gives an error:

>>> arr = np.array(["some", "strings"], dtype=np.dtypes.StringDType())
>>> arr
array(['some', 'strings'], dtype=StringDType())
>>> pa.array(arr)
...
ArrowNotImplementedError: Unsupported numpy type 2056

But ideally we should support this dtype both for conversion from numpy -> arrow, as in the arrow -> numpy conversion (although here it should probably be opt-in and by default still return object dtype)

Numpy provides a C API to access the individual string elements: https://numpy.org/devdocs/reference/c-api/strings.html

  • [Python] Conversion from Arrow string to numpy StringDtype

Activity

  1. github-actions commented on Nov 18, 2025

    @github-actions

    This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.

  2. added
    Status: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwise
    on Nov 18, 2025
  3. alippai commented on Dec 2, 2025

    @alippai
    Contributor

    I believe this is not stale, numpy is continuously improving the StringDType support.

    @jorisvandenbossche would this be implemented on the C++ side or cython/python?

  4. thisisnic commented on Feb 18, 2026

    @thisisnic
    Member

    This issue has been closed because there has been no activity for the 14 days since the stale warning. Feel free to reopen if this has been closed in error.

  5. alippai commented on Feb 18, 2026

    @alippai
    Contributor

    @thisisnic there was clear activity (both comment and pending MR). Is the script broken?

  6. thisisnic commented on Feb 18, 2026

    @thisisnic
    Member

    Doing it manually due to GitHub API limits on the CI job, and it's missed the logic for where the label has been left but someone has commented. Will reopen!

  7. added
    Status: needs championHigh impact issues which aren't being worked on but require a volunteer to move the task forward.
    and removed
    Status: stale-warningIssues and PRs flagged as stale which are due to be closed if no indication otherwise
    on Feb 18, 2026
  8. alippai commented on Feb 18, 2026

    @alippai
    Contributor

    Thanks for keeping the issue queue tidy

  9. rok commented on Jul 18, 2026

    @rok
    Member
  10. 16 remaining items

  11. added 8 commits that reference this issue on Sep 3, 2026
  12. lorentzenchr commented on Sep 28, 2026

    @lorentzenchr
    Contributor

    What about the conversion to numpy with to_numpy?

  13. ngoldbaum commented on Sep 28, 2026

    @ngoldbaum
    Contributor

    What about the conversion to numpy with to_numpy?

    That will be a bigger code change and also might require disentangling the NumPy and Pandas exporters.

  14. lorentzenchr commented on Sep 28, 2026

    @lorentzenchr
    Contributor

    Is it agreed upon?

  15. ngoldbaum commented on Sep 28, 2026

    @ngoldbaum
    Contributor

    I'm not working on it. 🤷‍♂️

  16. jorisvandenbossche commented on Sep 30, 2026

    @jorisvandenbossche
    MemberAuthor

    I think it is certainly something we want to support in theory, but it will require someone to dive into it

  17. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions