Skip to content

__array__ needs to be updated to accept copy kwarg #3583

@ariostas

Description

@ariostas

Version of Awkward Array

main

Description and code to reproduce

__array__ needs to be updated to conform with NumPy 2.0 requirements.

Doing the following,

import awkward as ak
import numpy as np

a = ak.Array([1,2,3])
b = np.array(a)

you get the following warning

DeprecationWarning: __array__ implementation doesn't accept a copy keyword, so passing copy=False failed. __array__ must implement 'dtype' and 'copy' keyword arguments. To learn more, see the migration guide https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug (unverified)The problem described would be a bug, but needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions