persist-types: apply redaction in stats debug_json rendering#37462
Draft
jasonhernandez wants to merge 1 commit into
Draft
persist-types: apply redaction in stats debug_json rendering#37462jasonhernandez wants to merge 1 commit into
jasonhernandez wants to merge 1 commit into
Conversation
PrimitiveStats redacts lower/upper bounds in its Debug impl, but the aggregate stats types (StructStats, PartStats, OptionStats, ColumnarStats) render Debug through debug_json, which did not apply the same masking. Route the debug_json leaves through the identical redaction, a no-op when soft assertions are enabled, so Debug output is consistently redacted regardless of which stats type it starts from. Exposes the redact character mapping from mz_ore::str so both renderers share one definition. SEC-618 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
PrimitiveStatsalready redacts itslower/upperbounds in itsDebugimpl viamz_ore::str::redact. The aggregate stats types (StructStats,PartStats,OptionStats,ColumnarStats) renderDebugthroughdebug_json, which did not apply the same masking, so the redaction behavior depended on which type the formatting started from.This routes the
debug_jsonleaf renderings (PrimitiveStats<T>,PrimitiveStats<Vec<u8>>,AtomicBytesStats,FixedSizeBytesStats) through the identical masking, keepingDebugoutput consistent across the stats hierarchy. As withredact, the masking is a no-op when soft assertions are enabled, so dev and test output is unchanged. Non-value fields (kind,len, column names, null counts) are left as is, mirroring the existingDebugimpls.The redact character mapping is now exposed as
mz_ore::str::redact_charso both renderers share one definition.debug_jsonhas no consumers outside theDebug/Serializerendering paths and tests, so no behavior change beyond the debug formatting.Internal tracking: SEC-618
Test plan
mz-persist-typescargo test -p mz-persist-types -p mz-orepassescargo clippy -p mz-persist-types -p mz-ore --all-targetsclean🤖 Generated with Claude Code