Skip to content

fix(data): count whitespace values read as null - #3205

Merged
Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:fix/whitespace-null-notices
Nov 28, 2026
Merged

Mavrick-F merged 1 commit into
opengeos:mainfrom
Mavrick-F:fix/whitespace-null-notices

Conversation

@Mavrick-F

@Mavrick-F Mavrick-F commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Summary

A CSV cell containing only spaces could become null when its column was inferred as numeric, without a loss notice. The shared CSV and workbook table reader now counts those actual conversions and emits one DroppedValue notice with the affected count and column names.

Column inference and parsed values keep their existing behavior. Genuinely empty cells, explicit null markers and whitespace retained in text columns are excluded. XML readers normalize their text earlier and are outside this change. The shared reader reaches existing desktop, browser, CLI, Python and phone import paths without new commands or controls. Counts use field-sized metadata and add no layer copy.

Testing

  • The actual CSV-reader regression failed on the baseline because its whitespace-loss notice was absent.
  • The regression distinguishes four discarded whitespace values from empty cells, a null marker and a preserved text-space cell, and includes a clean control.
  • The focused regression and clean control passed after the fix. Independent review approved the change with no blocking findings. The full Linux fork gate passed on 562ff11c11.

Related issue

Part of #1998.

Summary by CodeRabbit

  • Bug Fixes
    • CSV import now reports whitespace-only values that are discarded from inferred non-text fields, while leaving whitespace retained as text unreported.
    • Existing null-marker and unread-date reporting remains unchanged.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

CSV import now reports whitespace-only values that become null in inferred non-text columns. The notice includes the total count and affected fields. Whitespace-only values retained as text are not included.

Changes: CSV whitespace-loss notices

Layer / File(s) Summary
Count and report whitespace losses
crates/data/src/io.rs
read_rows counts whitespace-only values that become null in non-text columns and emits one DroppedValue notice with the count and affected fields. Tests check text retention and that clean input produces no notice.

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

Change: Bug fix

Possibly related issues

Possibly related PRs

  • opengeos/RustGIS#2303: Both PRs concern whitespace handling and notices in the CSV reader. This PR counts whitespace-only values dropped from non-text columns.

Suggested reviewers: elpidioassinaturas, pick2510, choupeanut

Merge Risk: Minimal · up to 562ff

CSV and workbook import now reports whitespace-only values that become null in numeric columns. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: whitespace-only CSV values that become null are now counted. It follows the conventional-commit style and matches the raw summary and objectives. It is specific enough…
Description check Passed The description covers the Summary and Testing sections with specific content. The UI evidence section is handled correctly: it has no visible UI change, and the template line is not removed. The Rela…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: whitespace-only CSV values that become null are now counted. It follows the conventional-commit style and matches the raw summary and objectives. It is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description covers the Summary and Testing sections with specific content. The UI evidence section is handled correctly: it has no visible UI change, and the template line is not removed. The Related issue section says 'Part of #1998', which satisfies the template. The description is complete enough to pass.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks each CSV cell,
Whitespace lost gets counted well.
The fields appear within the note,
While text stays as it was wrote.
Clean rows pass without a sound.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: d57eb506-71b3-4055-8750-552e900276b3
Commits

Reviewing files that changed from the base of the PR and between f81b3b5 and 562ff11.

Files selected for processing: 1

  • crates/data/src/io.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview

Item Value
Preview https://preview.rustgis.app/pr-3205/
Web app https://preview.rustgis.app/pr-3205/app/
Commit 562ff11

GitHub Pages takes a minute or two to publish a new commit. Newer commits from the fork aren't published until a maintainer adds the preview label (once per commit).

@Mavrick-F
Mavrick-F added this pull request to the merge queue Nov 28, 2026
Merged via the queue into opengeos:main with commit e041087 Nov 28, 2026
28 checks passed
@Mavrick-F
Mavrick-F deleted the fix/whitespace-null-notices branch November 28, 2026 07:00
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.

1 participant