Skip to content

Hash DecimalScalars consistently with their equality - #12361

Open
seragAhmed wants to merge 1 commit into
vortex-data:developfrom
seragAhmed:fix/11958-decimal-scalar-eq-hash
Open

seragAhmed wants to merge 1 commit into
vortex-data:developfrom
seragAhmed:fix/11958-decimal-scalar-eq-hash

Conversation

@seragAhmed

Copy link
Copy Markdown
Contributor

DecimalScalar derived Hash over its full dtype, including nullability, while PartialEq ignores nullability, so two scalars differing only in nullability compared equal but could hash differently. Hashing now uses DType::hash_ignore_nullability, matching ListScalar and ExtScalar.

AI assistance: this change was written with Claude Code and reviewed by me.

DecimalScalar derived Hash over its full dtype, including nullability,
while PartialEq ignores nullability. Two decimal scalars that differ only
in nullability compared equal but could hash differently, breaking the
Eq/Hash contract. Hash the dtype with hash_ignore_nullability, as
ListScalar and ExtScalar already do.

Closes vortex-data#11958

Signed-off-by: Serag Ahmed <serag.science2011@gmail.com>

This branch has not been deployed

No deployments
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.

Keep DecimalScalar equality and hashing consistent

1 participant