Skip to content

Unimplement PartialEq, PartialOrd from ToRepartition, RePartition#17441

Merged
crepererum merged 1 commit into
apache:mainfrom
findepi:findepi/unimplement-partialeq-partialord-from-torepartition-repartition-a7502a
Sep 5, 2025
Merged

Unimplement PartialEq, PartialOrd from ToRepartition, RePartition#17441
crepererum merged 1 commit into
apache:mainfrom
findepi:findepi/unimplement-partialeq-partialord-from-torepartition-repartition-a7502a

Conversation

@findepi

@findepi findepi commented Sep 5, 2025

Copy link
Copy Markdown
Member

The implementations of PartialEq and PartialOrd were not consistent violating the PartialOrd contract. These traits are used only to use the ToRepartition/RePartition in a BinaryHeap, so it's easy to fix. However, having type-level partial eq (instead of derived) can be fairly misleading. Instead, these are implemented on a newtype pattern, making the semantics clear.

…ion`

The implementations of `PartialEq` and `PartialOrd` were not consistent
violating the `PartialOrd` contract. These traits are used only to use
the `ToRepartition`/`RePartition` in a `BinaryHeap`, so it's easy to
fix. However, having type-level partial eq (instead of derived) can be
fairly misleading. Instead, these are implemented on a newtype pattern,
making the semantics clear.
@github-actions github-actions Bot added the datasource Changes to the datasource crate label Sep 5, 2025

@crepererum crepererum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense

@crepererum
crepererum merged commit 9b82a1e into apache:main Sep 5, 2025
29 checks passed
@findepi
findepi deleted the findepi/unimplement-partialeq-partialord-from-torepartition-repartition-a7502a branch September 5, 2025 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

datasource Changes to the datasource crate

2 participants