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

feat: add support for expected termination of transform functions #2595

Merged
merged 6 commits into from
Aug 4, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jul 27, 2023

#2593 demonstrates a case where it would be nice for ak.transform to be able to error if the user function never terminates.

This PR adds an expect_return_value argument, which causes ak.transform to throw a RuntimeError if the user transform is supposed to return a non-None value, but never terminates.

@agoose77 agoose77 temporarily deployed to docs-preview July 27, 2023 14:06 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Jul 27, 2023

Codecov Report

Merging #2595 (2ee730a) into main (ce63bf2) will increase coverage by 0.01%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
Files Changed Coverage Δ
src/awkward/operations/ak_transform.py 95.23% <100.00%> (+0.89%) ⬆️

... and 1 file with indirect coverage changes

@agoose77 agoose77 requested a review from jpivarski July 27, 2023 14:24
@agoose77 agoose77 marked this pull request as ready for review July 27, 2023 14:24
@agoose77 agoose77 temporarily deployed to docs-preview July 27, 2023 14:30 — 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.

Okay, this is a safety check on ak.transform users.

It's good to merge, but I'll let you press the button in case there are any last fixes.

@agoose77 agoose77 enabled auto-merge (squash) August 4, 2023 08:43
@agoose77 agoose77 temporarily deployed to docs-preview August 4, 2023 08:54 — with GitHub Actions Inactive
@agoose77 agoose77 merged commit 089f843 into main Aug 4, 2023
32 checks passed
@agoose77 agoose77 deleted the agoose77/feat-expect-termination branch August 4, 2023 09:01
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