Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

grtlr
Copy link
Member

@grtlr grtlr commented Sep 30, 2025

Related

What

This PR allows you to use the minus sign (-) formatting option in most RecordBatch-derived structs to get a string that has non-deterministic values redacted.

Usage:

let chunk = Chunk::new(/* ... */);
println!("{chunk:-}");

Using # instead of - would be an alternative, but I think it's better to reserve this for a more meaningful representation.

@grtlr grtlr added the exclude from changelog PRs with this won't show up in CHANGELOG.md label Sep 30, 2025
Copy link

github-actions bot commented Sep 30, 2025

Web viewer built successfully.

Result Commit Link Manifest
f9c5a84 https://rerun.io/viewer/pr/11383 +nightly +main

Note: This comment is updated whenever you push a commit.

@grtlr grtlr requested a review from Copilot October 2, 2025 11:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a - formatting option for redacted values in RecordBatch-derived structs to support snapshot testing with non-deterministic values. The change allows using {:-} format specifier to get string representations with redacted non-deterministic content like TUIDs.

  • Updates Display implementations to pass the sign_minus() flag to formatting functions
  • Modifies format_record_batch_with_width to accept a redact_non_deterministic parameter
  • Removes custom redaction wrapper structs in favor of the new formatting option

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
crates/store/re_format_arrow/src/lib.rs Adds redact_non_deterministic parameter to format_record_batch_with_width function
crates/store/re_chunk/src/chunk.rs Updates Display impl to pass f.sign_minus() for redaction control
crates/store/re_sorbet/src/sorbet_batch.rs Updates Display impl to pass f.sign_minus() for redaction control
crates/store/re_sorbet/src/chunk_batch.rs Updates Display impl to pass f.sign_minus() for redaction control
crates/store/re_dataframe/src/query.rs Updates test helper to pass f.sign_minus() for redaction control
crates/store/re_chunk/tests/formatting.rs Removes custom ChunkRedacted wrapper and uses new - format option
crates/utils/re_mcap/src/layers/protobuf.rs Removes custom ChunkRedacted wrapper and uses new - format option
crates/utils/re_mcap/Cargo.toml Removes unused re_format_arrow dev dependency
CODE_STYLE.md Documents the new - formatting option convention

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@grtlr grtlr requested a review from emilk October 2, 2025 11:16
@grtlr grtlr merged commit f42d292 into main Oct 2, 2025
40 checks passed
@grtlr grtlr deleted the grtlr/minus-sign-formatting branch October 2, 2025 12:09
grtlr added a commit that referenced this pull request Oct 2, 2025
### Related

* Post-merge comment:
#11383 (comment)

### What

See comment linked above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exclude from changelog PRs with this won't show up in CHANGELOG.md
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants