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: some usages of len(layout) under typetracer #2181

Merged
merged 3 commits into from
Jan 31, 2023

Conversation

agoose77
Copy link
Collaborator

This PR fixes a few (but certainly not all) places where we're using len(layout), or otherwise relying on a layout to be non-typetracer

@agoose77
Copy link
Collaborator Author

@lgray this would fix dak.with_name() without the meta bypass.

@codecov
Copy link

codecov bot commented Jan 31, 2023

Codecov Report

Merging #2181 (163b1d3) into main (a91d96b) will increase coverage by 0.04%.
The diff coverage is n/a.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/operations/ak_full_like.py 98.18% <ø> (ø)
src/awkward/operations/ak_with_name.py 100.00% <ø> (ø)
src/awkward/contents/recordarray.py 84.91% <0.00%> (+0.41%) ⬆️
src/awkward/index.py 90.44% <0.00%> (+0.63%) ⬆️
src/awkward/_nplikes/typetracer.py 74.02% <0.00%> (+0.74%) ⬆️
src/awkward/_errors.py 80.52% <0.00%> (+1.05%) ⬆️

@agoose77 agoose77 temporarily deployed to docs-preview January 31, 2023 14:27 — with GitHub Actions Inactive
@agoose77 agoose77 self-assigned this Jan 31, 2023
@agoose77 agoose77 removed their assignment Jan 31, 2023
@agoose77 agoose77 changed the title fix: use of len(layout) fix: use of len(layout) under typetracer Jan 31, 2023
@agoose77 agoose77 changed the title fix: use of len(layout) under typetracer fix: some usages of len(layout) under typetracer Jan 31, 2023
@agoose77 agoose77 temporarily deployed to docs-preview January 31, 2023 14:38 — with GitHub Actions Inactive
@lgray
Copy link
Contributor

lgray commented Jan 31, 2023

Can this one be merged to main or waiting for something?

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.

It was waiting for my review.

It's all good! Replacing len(layout) with layout.length is something we should be doing everywhere, ever since the length property was introduced (since it does not require the result to be an integer).

@jpivarski jpivarski merged commit cda7688 into main Jan 31, 2023
@jpivarski jpivarski deleted the agoose77/incr-fix-with-name branch January 31, 2023 17:31
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.

None yet

3 participants