Repository navigation
Decode stored DecimalType and PType values strictly - #10755
connortsui20 wants to merge 3 commits into
Conversation
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
Merging this PR will regress 3 benchmarks4 warnings, 1 note
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
Summary
The prost getters for enumeration fields decode an unknown stored value as the first variant, so a stored
DecimalTypeorPTypeoutside its enum silently read asI8orU8. A file read now returns aSerdeerror instead.Changes
Each metadata struct with a stored
DecimalTypeorPTypefield gets aget_<field>()accessor that rejects an unknown value, and eachdeserializecalls it right after decoding the metadata, before any buffer or child read. The protobuf dtype decoder converts itsPTypethroughpb::PType::try_fromin the same way, which also covers the dtypes stored by Variant arrays, scalars and cast options. The flatbuffer path was already strict, and its error now includes the raw value. The wire format does not change, and every value that a current writer stores reads as before. Each rejection test goes through the realdeserializeor layoutbuildpath and checks the fullSerdeerror with a newtest_harness::assert_serde_errorhelper.compat.py check --mode allpasses against every published fixture.The decimal width has to be strict before the read path for old decimal arrays in #10701 can rely on it. For review, read the commits one at a time: the decimal width, the protobuf dtype, then the eleven
PTypefields of array and layout metadata.🤖 Generated with Claude Code