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 exception for missing field #2120

Merged
merged 2 commits into from
Jan 13, 2023

Conversation

agoose77
Copy link
Collaborator

@agoose77 agoose77 commented Jan 13, 2023

Fixes #2086 by introducing a new error type.

@jpivarski
Copy link
Member

I think @lgray wanted to know about this, since it's a way to catch Spark jobs that either had column names incorrectly optimized away or are missing for some other reason. The new exception type allows you to distinguish between spelling a column name wrong and other slicing errors (which are all IndexError, including this new FieldNotFoundError, through a subclass).

It will be going into the 2.0.6 release today.

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.

Looks good! I'll merge it if the tests pass, and fix it if they don't. It will go into 2.0.6 today.

@jpivarski jpivarski enabled auto-merge (squash) January 13, 2023 18:21
@agoose77 agoose77 temporarily deployed to docs-preview January 13, 2023 18:29 — with GitHub Actions Inactive
@codecov
Copy link

codecov bot commented Jan 13, 2023

Codecov Report

Merging #2120 (d65ed84) into main (c647046) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files
Impacted Files Coverage Δ
src/awkward/forms/recordform.py 87.83% <ø> (ø)
src/awkward/_errors.py 77.24% <100.00%> (+0.24%) ⬆️

@jpivarski jpivarski merged commit aa202ee into main Jan 13, 2023
@jpivarski jpivarski deleted the agoose77/feat-field-missing-exception branch January 13, 2023 18:40
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.

Add a "field does not exist" IndexError subclass
2 participants