feat: standardize prep step confirmation messages - #283
Open
iabaako wants to merge 1 commit into
Open
Conversation
…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.
|
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.



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 tracksremaining_rowsandremaining_columnsseparately instead of a singleambiguous
remaining_count.remove_rows,remove_columns,add_new_column,transform_columns) now end with astandard
"Dataset now has N rows and M columns."clause via a shared_with_remaininghelper.remove_rowsnow builds a human-readable clause from the actualselected column(s), condition, and value (e.g.
where "age" value is greater than 65), or the row indexes for index-based removal, insteadof just echoing the method label ("by condition"/"by row index").
src/datasure/processing/prep.py's four operation handlers(
RemoveRowsOperation,RemoveColumnsOperation,TransformColumnsOperation,AddNewColumnOperation) now populateremaining_rows/remaining_columnsfrom the resulting DataFrame'sheight/width.
Out of scope:
prep_utils.pycontains a number of per-operation messagebuilders (string/numeric/datetime function messages, index/uuid/random
column messages, etc.) and a
generate_messagedispatcher that are fullyunit-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 tokeep the change focused and low-risk.
How to test or reproduce ? 🧪
uv run datasure) and open a project's prep viewcolumn, apply it, and confirm the message now names the column,
condition, and value, plus rows and columns remaining
message ends with "Dataset now has N rows and M columns."
Screenshots (if applicable) 📷
N/A (text-only message change)
Checklist ✅