Fix Python float/int validation against float64/int64 specs#1410
Merged
Conversation
…pecs Python native `float` and `int` are 64-bit, but `get_type()` was returning "float" and "int" which map to float32 and int32 in the spec system. This caused validation failures when Zarr attributes (read from JSON as native Python types) were checked against float64/int64 specs. Now `get_type()` returns "float64" for Python `float` and "int64" for Python `int`. Fixes #1368 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1410 +/- ##
=======================================
Coverage 92.84% 92.85%
=======================================
Files 41 41
Lines 9986 9990 +4
Branches 2052 2054 +2
=======================================
+ Hits 9272 9276 +4
Misses 436 436
Partials 278 278 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
oruebel
approved these changes
Mar 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
floatis 64-bit, butget_type()was returning"float"which aliases to float32 in the spec system, causing validation failures against float64 specsint(64-bit or larger) returning"int"which aliases to int32get_type()to return"float64"for Pythonfloatand"int64"for Pythoninttype(data) is float) to avoid catching numpy subclasses orbooladditional_allowedFixes #1368
Test plan
floatvalidates againstfloat64spec (was failing, now passes)intvalidates againstint64spec (was failing, now passes)floatstill validates againstfloat(float32) spec (regression check)intstill validates againstint(int32) spec (regression check)🤖 Generated with Claude Code