Skip to content

BUG: numpy.char.chararray is deprecated #19216

Closed

Description

@neutrinoceros

xref: numpy/numpy#30605

this causes about 800 tests to fail, most of which correspond to a single failure mode where we check an object type with isinstance and can easily be handled (I'll open a patch in a sec).
The rest of them are not necessarily difficult to handle, but patching may require breaking changes since we may need to change the return type of public functions (possibly indirectly) in cases where we deliberately instantiate this class.

Related issue:

Linked PRs:

Activity

  1. neutrinoceros commented on Jan 26, 2026

    @neutrinoceros
    ContributorAuthor

    all remaining failures are coming from a single line in io.fits where we intentionally create a np.char.chararray view. Not sure how to change it yet. See https://github.com/astropy/astropy/pull/19217/changes#r2726958048

  2. changed the title [-]BUG: numpy.char.charray is deprecated[/-] [+]BUG: numpy.char.chararray is deprecated[/+] on Jan 26, 2026
  3. saimn commented on Jan 26, 2026

    @saimn
    Contributor

    See also #3862, it's not only about isinstance checks, io.fits relies on chararray to automatically strip trailing spaces from string columns.

  4. neutrinoceros commented on Jan 26, 2026

    @neutrinoceros
    ContributorAuthor

    Yes. #19217 is only meant to eliminate the dominant failure mode that'll hit CI in a couple days. I'm hoping we can tackle other long term issues after that

  5. pllim commented on Feb 3, 2026

    @pllim
    Member

    Until we can figure out a proper solution (which seems non-trivial), should we just ignore the DeprecationWarning for now? It is very disruptive. I have issued a memo on astropy-dev asking downstream to ignore it.

  6. neutrinoceros commented on Feb 3, 2026

    @neutrinoceros
    ContributorAuthor

    It looks non trivial indeed. I'd be happy to dive further in, I've just been reluctant to do it while this PR is unresolved

  7. iamtanishqjain commented on Feb 4, 2026

    @iamtanishqjain
  8. neutrinoceros commented on Feb 4, 2026

    @neutrinoceros
    ContributorAuthor

    thanks for offering but we're already working on it.

  9. linked a pull request that will close this issueHandle chararray deprecation #19267on Feb 4, 2026
  10. iamtanishqjain commented on Feb 9, 2026

    @iamtanishqjain
  11. pllim commented on Feb 12, 2026

    @pllim
    Member

    Can I re-request #19216 (comment) again for the warning to be temporarily ignored? We could easily miss remote data test problems (e.g., #19294) unless we also run Extra CI, which is optional.

  12. neutrinoceros commented on Feb 12, 2026

    @neutrinoceros
    ContributorAuthor

    I would still prefer #19217 as the temporary patch, but it doesn't seem to be going anywhere, so if that's the only way forward, let's do it.

  13. pllim commented on Feb 13, 2026

    @pllim
  14. pllim commented on Feb 13, 2026

    @pllim
    Member

    #19303 works and does not change any functionality. Turns out I have to ignore the warning in not 1, but 3 places, but I do have to ignore it in functional code, not just the test. I think reverting this should be easy enough when a more serious fix is ready to go?

  15. neutrinoceros commented on Feb 13, 2026

    @neutrinoceros
    ContributorAuthor
  16. pllim commented on Feb 20, 2026

    @pllim
    Member

    I am going to keep this open until we have a backport version, so we don't forget.

  17. reopened this on Feb 20, 2026
  18. added this to the v7.2.1 milestone on Feb 20, 2026
  19. pllim commented on Feb 26, 2026

    @pllim
    Member

    Manual backport happened. This is done. Thanks, everyone!

    #19335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions