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

Compare with is (vs ==) in enum rule #675

Closed
wants to merge 1 commit into from

Conversation

ankostis
Copy link
Contributor

@ankostis ankostis commented Apr 3, 2020

Similar to #164, this patch avoids calling overridden __eq__() in the modified enum rule after v3.0.2 (due to #575),
so that e.g. pandas (series & dataframes) don't choke on enum rules.

…)...

 to evade failures due to overridden equals e.g. pandas.
 Patches changes of python-jsonschema#575.
@Julian
Copy link
Member

Julian commented Apr 3, 2020

Hi. Thanks.

This one is trickier -- it's not necessarily correct here. Unlike #164, those aren't singletons -- an implementation is free to have 0 == 0 but the two 0's not being the same object.

@Julian
Copy link
Member

Julian commented Apr 3, 2020

(So might need to think about what a solution that'd work here would be, but a failing test would be great as well!)

@ankostis
Copy link
Contributor Author

ankostis commented Apr 3, 2020

but a failing test would be great as well!

I had long thought of building one, just to weed out some more hurdles when dealing with pandas as instances (it is possible to do that in the end, needs 2-3 interventions in the rules and more in the type checkers).

Let's hope, now that i managed to teach my quarantined daughter not to interrupt me too much :-), i manage to serve such a test case.
Would it be ok if it imported pandas?

ankostis added a commit to ankostis/pandalone that referenced this pull request Apr 3, 2020
@Julian
Copy link
Member

Julian commented Apr 3, 2020

Let's hope, now that i managed to teach my quarantined daughter not to interrupt me too much :-), i manage to serve such a test case.

Ha! Good luck (hope you, her and the rest of your family are all well...)

Would it be ok if it imported pandas?

If need be that's fine, though I suspect it'll be simpler to define a small class with an __eq__ that has the peculiarity that's relevant here? But if it's tons simpler either is fine.

ankostis added a commit to ankostis/pandalone that referenced this pull request Apr 3, 2020
ankostis added a commit to ankostis/pandalone that referenced this pull request Apr 4, 2020
ankostis added a commit to ankostis/pandalone that referenced this pull request Apr 4, 2020
@Julian Julian marked this pull request as draft April 18, 2020 16:59
@Julian Julian closed this Oct 20, 2020
@Julian Julian deleted the branch python-jsonschema:master October 20, 2020 16:37
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

2 participants