refactor: Rename --hidden-columns to --hidden-column in CLI#37
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #37 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 11 11
Lines 1014 1018 +4
=========================================
+ Hits 1014 1018 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the diffly CLI to use a singular repeatable flag name (--hidden-column) instead of the previous plural form (--hidden-columns), aligning the option name with how it’s used (multiple occurrences).
Changes:
- Renamed the Typer CLI option parameter from
hidden_columnstohidden_column(resulting in--hidden-column). - Wired the renamed CLI argument through to
comparison.summary(hidden_columns=...).
Comments suppressed due to low confidence (1)
diffly/cli.py:131
- The CLI option was renamed to
hidden_column(i.e.,--hidden-column), but the help text forsample_k_rows_onlyandshow_sample_primary_key_per_changeearlier in this function still refers tohidden_columns. This will confuse users reading--help; update those help strings to reference the new option name (or avoid hard-coding the option name in the message).
hidden_column: Annotated[
list[str],
typer.Option(
help=(
"Columns for which no values are printed, e.g. because they contain"
"sensitive information."
)
),
] = [],
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Oliver Borchert (borchero)
left a comment
There was a problem hiding this comment.
By marking this as breaking, we'd need to jump to v2. I don't think this is warranted. Is there a way to make typer accept --hidden-columns but map it to --hidden-column and emit a warning?
Oliver Borchert (borchero)
left a comment
There was a problem hiding this comment.
Great, thanks!
Good point Oliver Borchert (@borchero). There is nothing too fancy in > pixi run diffly left.parquet right.parquet --primary-key id --hidden-columns secret
/Users/.../git/diffly/diffly/cli.py:140: FutureWarning: `--hidden-columns` is deprecated, use `--hidden-column` instead.
warnings.warn(
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Diffly Summary ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Primary key: id
Schemas
▔▔▔▔▔▔▔
Schemas match exactly (column count: 3).
Rows
▔▔▔▔
Left count Right count
4 (no change) 4
┏━┯━┯━┯━┯━┓
┃-│-│-│-│-┃ 1 left only (25.00%)
┠─┼─┼─┼─┼─┨╌╌╌┏━┯━┯━┯━┯━┓╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╮
┃ │ │ │ │ ┃ = ┃ │ │ │ │ ┃ 2 equal (66.67%) │
┠─┼─┼─┼─┼─┨╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌├╴ 3 joined
┃ │ │ │ │ ┃ ≠ ┃ │ │ │ │ ┃ 1 unequal (33.33%) │
┗━┷━┷━┷━┷━┛╌╌╌┠─┼─┼─┼─┼─┨╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╯
┃+│+│+│+│+┃ 1 right only (25.00%)
┗━┷━┷━┷━┷━┛
Columns
▔▔▔▔▔▔▔
┌────────┬─────────┐
│ secret │ 100.00% │
│ val │ 66.67% │
└────────┴─────────┘This part annoys me a little bit: |
|
We still need to remove |
--hidden-columns to --hidden-column in CLI--hidden-columns to --hidden-column in CLI
Motivation
In the CLI,
--hidden-columnsis a repeatable option. Therefore, it feels nicer for the name to be singular:--hidden-column.Changes
Renamed the option to
--hidden-column.Example