Skip to content

feat: standardize prep step confirmation messages - #283

Open
iabaako wants to merge 1 commit into
fix/281-null-sort-remove-rowsfrom
improve/prep-message-clarity
Open

feat: standardize prep step confirmation messages#283
iabaako wants to merge 1 commit into
fix/281-null-sort-remove-rowsfrom
improve/prep-message-clarity

Conversation

@iabaako

@iabaako iabaako commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Pull Request Summary 🚀

What does this PR do? 📝

Standardizes the confirmation messages shown after applying a data prep
step (remove rows, remove columns, add column, transform column) into one
consistent format, and fixes the vague "remove rows by condition" message
to state the actual column, operator, and value.

Why is this change needed? 🤔

Prep messages like "✓ 122 rows removed. Deleted rows by condition. 243
rows remaining in your dataset." didn't say what condition was applied,
and different action types inconsistently reported only rows remaining or
only columns remaining (never both).

How was this implemented? 🛠️

  • PrepActionResult (src/datasure/utils/prep_utils.py) now tracks
    remaining_rows and remaining_columns separately instead of a single
    ambiguous remaining_count.
  • All four live confirmation message builders (remove_rows,
    remove_columns, add_new_column, transform_columns) now end with a
    standard "Dataset now has N rows and M columns." clause via a shared
    _with_remaining helper.
  • remove_rows now builds a human-readable clause from the actual
    selected column(s), condition, and value (e.g. where "age" value is greater than 65), or the row indexes for index-based removal, instead
    of just echoing the method label ("by condition"/"by row index").
  • src/datasure/processing/prep.py's four operation handlers
    (RemoveRowsOperation, RemoveColumnsOperation,
    TransformColumnsOperation, AddNewColumnOperation) now populate
    remaining_rows/remaining_columns from the resulting DataFrame's
    height/width.

Out of scope: prep_utils.py contains a number of per-operation message
builders (string/numeric/datetime function messages, index/uuid/random
column messages, etc.) and a generate_message dispatcher that are fully
unit-tested but never actually invoked by the app (only 4 broad handlers
are wired up in prep.py). This PR leaves that dead code untouched to
keep the change focused and low-risk.

How to test or reproduce ? 🧪

  1. Start the app (uv run datasure) and open a project's prep view
  2. Add a "remove rows" step with a range/comparison condition on a real
    column, apply it, and confirm the message now names the column,
    condition, and value, plus rows and columns remaining
  3. Add/remove a column and transform a column; confirm each confirmation
    message ends with "Dataset now has N rows and M columns."

Screenshots (if applicable) 📷

N/A (text-only message change)

Checklist ✅

  • I have run and tested my changes locally
  • I have limit this PR to less than 1000 lines of code change (if not, explain why)
  • I have updated/added tests to cover my changes (if applicable)
  • I have updated/added requirements to cover my changes (if applicable)
  • I have run linting and formatting on any code changes (if applicable)
  • I have updated the documentation (README, etc.) accordingly
  • I have reviewed and resolved any merge conflict

…row/column counts

Row/column-removal, transform, and add-column confirmation messages were
vague (e.g. "Deleted rows by condition" didn't say which column, operator,
or value) and inconsistently reported only rows or only columns remaining.

PrepActionResult now tracks remaining_rows and remaining_columns
separately, and all four live message templates end with a consistent
"Dataset now has N rows and M columns" clause. The remove-rows message
also now states the actual column, condition, and value (or row indexes)
instead of just the method label.
@iabaako
iabaako requested a review from a team as a code owner August 29, 2026 18:27
@sonarqubecloud

Copy link
Copy Markdown

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