Skip to content

BUG: clearing of array data too aggressive after gh-22924 #23277

@mhvk

Description

@mhvk

Describe the issue:

#22924 introduced failures in astropy (and likely in pandas). It is almost certainly to do with zero-length object dtype arrays; pure numpy example below.

Reproduce the code example:

import numpy as np
np.recarray((0,), dtype="O") 
# rec.array([],
#           dtype=|V8)
exit()

Error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
RuntimeError: Internal error, tried to fetch clear function for the user dtype '' without fields or subarray (legacy support).

Runtime information:

1.25.0.dev0+802.g5f04e748b
3.11.1 (main, Dec 31 2022, 10:23:59) [GCC 12.2.0]

Context for the issue:

See #22924 (comment) and below.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions