Skip to content
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

fix: re-order cases to handle NumPy scalar types properly #2125

Merged
merged 10 commits into from
Jan 16, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jan 16, 2023

#2096 improved our type-handling, but had a sneaky bug in the ordering of the NumPy scalar type (np.int16()) handling: the generic Integral test would always catch these cases first, meaning that ak.type(np.int16) always produced ScalarType(NumpyType("int64")) etc.

This PR simplifies this logic by re-ordering the tests.

@codecov
Copy link

codecov bot commented Jan 16, 2023

Codecov Report

Merging #2125 (04cdb9c) into main (1e22929) will increase coverage by 0.00%.
The diff coverage is 54.16%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/_connect/rdataframe/from_rdataframe.py 0.00% <ø> (ø)
src/awkward/contents/bitmaskedarray.py 68.02% <0.00%> (ø)
src/awkward/contents/bytemaskedarray.py 88.80% <0.00%> (ø)
src/awkward/contents/listarray.py 90.08% <0.00%> (ø)
src/awkward/contents/listoffsetarray.py 80.11% <0.00%> (ø)
src/awkward/contents/numpyarray.py 91.37% <0.00%> (ø)
src/awkward/contents/recordarray.py 84.05% <0.00%> (ø)
src/awkward/contents/regulararray.py 88.47% <0.00%> (ø)
src/awkward/contents/unionarray.py 84.98% <0.00%> (ø)
src/awkward/types/type.py 95.95% <ø> (ø)
... and 2 more

@agoose77 agoose77 temporarily deployed to docs-preview January 16, 2023 10:15 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs-preview January 16, 2023 12:13 — with GitHub Actions Inactive
Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below.

tests/test_2125_type_of_scalar.py Show resolved Hide resolved
tests/test_2125_type_of_scalar.py Outdated Show resolved Hide resolved
tests/test_2125_type_of_scalar.py Show resolved Hide resolved
@agoose77 agoose77 enabled auto-merge (squash) January 16, 2023 20:01
@agoose77 agoose77 temporarily deployed to docs-preview January 16, 2023 20:16 — with GitHub Actions Inactive
@agoose77 agoose77 temporarily deployed to docs-preview January 16, 2023 21:30 — with GitHub Actions Inactive
@agoose77 agoose77 merged commit 1c22f05 into main Jan 16, 2023
@agoose77 agoose77 deleted the agoose77/fix-ak-type-scalar-type branch January 16, 2023 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants