-
Notifications
You must be signed in to change notification settings - Fork 89
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
Array.to_list fails when length is a numpy integer in 2.5.2 #2947
Comments
Internally we try to be careful to meaningfully type and discriminate between lengths and index values. According to our type hints, we expect lengths to be An example of where this is helpful is in So, I'll make a PR that looks to support |
@ivirshup this is a bug, but the fix will likely be |
That also makes sense. Tbh I had gotten started with the pinning while narrowing down the bug. |
Test against np.integer as well in ArrayModuleNumpyLike.shape_item_as_index such that it does not break if ak.from_buffers is built with a numpy integer instead of an integer
* fix: cast numpy integers to integers in ak.from_buffers (fixes scikit-hep#2947) * Add test for 3502225e9246ce0197d6143c9d94c9e1aeec88b8 * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Version of Awkward Array
2.5.2
Description and code to reproduce
Notably, this doesn't throw an error in 2.5.1.
The issue may be a bit more specific than the title, but we're running into this on the anndata test suite with some of our round-tripping IO tests.
In our use case we are serializing to hdf5. We're storing the length directly in hdf5, so h5py reads it out as a numpy integer. This the causes errors post reconstruction since awkward doesn't recognize the numpy integer length as the correct type.
The text was updated successfully, but these errors were encountered: