Skip to content

Relax conditions for warning on updating converters #29154

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

Merged
merged 2 commits into from
Nov 21, 2024

Conversation

ksunden
Copy link
Member

@ksunden ksunden commented Nov 18, 2024

Allow sub/superclass without warning.

This was motivated by Pandas, as they have several instances of the same class in the registry.
We also had this internally, though resolved that by using the same instance for multiple registry
entries rather than by relaxing the warning. This becomes impractical when dealing with downstream.

It may have been sufficient to allow only identical types, but to be safe, decided to allow both
sub- and superclass relationships.
The purpose of the warning was that it gets overwritten without heeding prior data provided which
would break in unexpected ways.
The most common case for this is when one converter class operates on multiple data types, but
separate instances of the class are in the registry. So while the previous data is compatible the
equality check still failed. Requiring downstream to implement equality checks seems impractical.

Additionally used both is and == for the earlier short circuit, which should in most cases be
identical operations, but just in case.

PR summary

PR checklist

Allow sub/superclass without warning.

This was motivated by Pandas, as they have several instances of the same class in the registry.
We also had this internally, though resolved that by using the same instance for multiple registry
entries rather than by relaxing the warning. This becomes impractical when dealing with downstream.

It may have been sufficient to allow only identical types, but to be safe, decided to allow both
sub- and superclass relationships.
The purpose of the warning was that it gets overwritten without heeding prior data provided which
would break in unexpected ways.
The most common case for this is when one converter class operates on multiple data types, but
separate instances of the class are in the registry. So while the previous data is compatible the
equality check still failed. Requiring downstream to implement equality checks seems impractical.

Additionally used both `is` and `==` for the earlier short circuit, which should in most cases be
identical operations, but just in case.
@QuLogic QuLogic added this to the v3.10.0 milestone Nov 18, 2024
@QuLogic
Copy link
Member

QuLogic commented Nov 19, 2024

Looks like the test was expecting the stricter behaviour.

@QuLogic
Copy link
Member

QuLogic commented Nov 20, 2024

It looks like macOS Azure is hitting actions/runner-images#10984

@tacaswell tacaswell merged commit 6ecda9c into matplotlib:main Nov 21, 2024
40 of 43 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Nov 21, 2024
QuLogic added a commit that referenced this pull request Nov 22, 2024
…154-on-v3.10.x

Backport PR #29154 on branch v3.10.x (Relax conditions for warning on updating converters)
ksunden pushed a commit to ksunden/matplotlib that referenced this pull request Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants