-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Better attr diff for testing.assert_identical
#8400
Conversation
07b7b3f
to
ad8e356
Compare
I think anything is welcome to improve the experience of seeing what exactly differ between two variables. However if this PR is treating the attributes only (IIUC) I find the diff could be potentially misleading. For variables with many attributes this is useful but in general I'm concerned that users who are not aware of this behavior will struggle figuring out why the variable reprs shown here differ from their full repr. Alternatively, couldn't we "highlight" the differing attributes but still show the full variable reprs? E.g.,
It requires a bit more work to implement, but this could nicely be generalized to other differing parts like the name, dimensions, labels, etc.:
(not sure about the best way to highlight those parts, though) |
Co-authored-by: Justus Magin <[email protected]>
Good idea but it doesn't scale to large datasets. Here's an example I'm looking at, with only one data variable:
I'll update to add "Differing attributes" to make it clear that we aren't printing all attributes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement!
whats-new.rst
This gives us better reprs where only differing attributes are shown in the diff.
On main:
With this PR: