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

Enh: Make RecordDifference more robust #402

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alcrene
Copy link
Contributor

@alcrene alcrene commented Apr 21, 2024

This fixes a corner case in records.py::RecordDifference.

In cases where record parameters are malformed, they may not load correctly as a dict, and then rec.parameters.pop raises AttributeError. One may still want to compare the record to another however – for example, to identify differences with a record where parameters are not malformed. Adding a hasattr guard helps with this corner case, and as far as I can tell has no downsides.

In cases where record parameters are malformed, they may not load
correctly as a dict, and then `rec.parameters.pop` raises AttributeError.
One may still want to compare the record to another however – for example,
to identify differences with a record where parameters are not malformed.
Adding a `hasattr` guard helps with this corner case, and as far as
I can tell has no downsides.
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.

1 participant