Skip to content

fix dataset info compression ratio and size units - #125

Open
pratik50 wants to merge 1 commit into
parseablehq:mainfrom
pratik50:datasetInfoFix
Open

pratik50 wants to merge 1 commit into
parseablehq:mainfrom
pratik50:datasetInfoFix

Conversation

@pratik50

@pratik50 pratik50 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Closes #123

Show n/a for the compression ratio when ingested or stored size is zero, instead of a misleading 100%.
Display dataset sizes in KiB, MiB, and GiB to match the parseable UI. Covers text and JSON output with tests.

Summary by CodeRabbit

  • Bug Fixes
    • Dataset information now displays ingestion and storage sizes using binary units, such as KiB and GiB, in both text and JSON output.
    • Compression ratios show “n/a” when either size is zero or unavailable; otherwise, they appear as percentages. The same values are now used across both output formats, making dataset statistics easier to compare.

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Essentials

Run ID: 1ce7996a-63cb-4b62-b4b5-0fae5b2818d3

📥 Commits

Reviewing files that changed from the base of the PR and between 25493c9 and 5b6f0b9.

📒 Files selected for processing (2)
  • cmd/dataset.go
  • cmd/dataset_test.go

Included review availability: This review used your included allowance. 2 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 5 reviews per hour.


📝 Walkthrough

Walkthrough

Dataset info now reports “n/a” when either ingestion or storage size is zero. JSON and text output both use the same compression-ratio value and display sizes with humanize.IBytes.

Changes

Dataset info output

Layer / File(s) Summary
Compression ratio and size output
cmd/dataset.go, cmd/dataset_test.go
The command reports “n/a” unless both sizes are positive, formats positive ratios as percentages, and uses humanize.IBytes for JSON and text sizes. Tests cover missing storage, empty data, stored data, GiB-sized values, and text output.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 5b6f0

No actionable issue remains in the supplied changes; the PR is ready for normal checks before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The change from humanize.Bytes to humanize.IBytes changes ingestion and storage size units to KiB, MiB, and GiB. Issue #123 addresses only the compression ratio for zero storage size. The unit cha… Remove the humanize.IBytes unit change and its unit-formatting assertions, or link the change to an active issue that requires Parseable-compatible size units.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the two main changes: fixing the dataset compression ratio and correcting dataset size units.
Linked Issues check ✅ Passed Issue #123 requires avoiding a misleading compression ratio when storage size is zero. The reviewed change returns n/a unless both ingestion and storage sizes are positive. JSON and text output use …
Full details: Out of Scope Changes check

Explanation

The change from humanize.Bytes to humanize.IBytes changes ingestion and storage size units to KiB, MiB, and GiB. Issue #123 addresses only the compression ratio for zero storage size. The unit change is not required to resolve that issue, even though the new tests cover it.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

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.

pb dataset info shows storage_size: 0 B with compression_ratio: 100.00% right after ingestion

1 participant