-
Notifications
You must be signed in to change notification settings - Fork 58
chore: address Andre's feedback on --save-results and CLI preview #335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
johnnygreco
merged 8 commits into
main
from
johnny/chore/updates-to-save-results-from-andre
Feb 19, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
796acfe
fix: suppress stdout when saving report and sample records to file
johnnygreco 1bd97f6
refactor: --save-results skips terminal display
johnnygreco 2c481ef
feat: wrap-around navigation in sample records browser
johnnygreco 2c88b04
test: reuse record_series fixture in visualization tests
johnnygreco a37e972
feat: thread --theme through to sample records pager
johnnygreco 331a435
fix: cap terminal display width at display_width
johnnygreco 851c7f0
docs: update --display-width and --theme help text
johnnygreco d9232f5
fix: update generation controller tests to match display_width and sa…
johnnygreco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,12 +27,12 @@ def preview_command( | |
| non_interactive: bool = typer.Option( | ||
| False, | ||
| "--non-interactive", | ||
| help="Display all records at once instead of browsing interactively.", | ||
| help="Display all records at once instead of browsing interactively. Ignored when --save-results is used.", | ||
| ), | ||
| save_results: bool = typer.Option( | ||
| False, | ||
| "--save-results", | ||
| help="Save preview results (dataset, report, and sample records) to the artifact path.", | ||
| help="Save results to disk without displaying sample records in the terminal.", | ||
| ), | ||
| artifact_path: str | None = typer.Option( | ||
| None, | ||
|
|
@@ -44,49 +44,16 @@ def preview_command( | |
| "dark", | ||
| "--theme", | ||
| click_type=click.Choice(["dark", "light"], case_sensitive=False), | ||
| help="Color theme for saved HTML files (dark or light). Only applies when --save-results is used.", | ||
| help="Color theme for HTML output (dark or light). Only applies when --save-results is used.", | ||
| ), | ||
| display_width: int = typer.Option( | ||
| DEFAULT_DISPLAY_WIDTH, | ||
| "--display-width", | ||
| help="Width of the rendered record output in characters.", | ||
| help="Maximum width of the rendered record output in characters.", | ||
| min=40, | ||
| ), | ||
| ) -> None: | ||
| """Generate a preview dataset for fast iteration on your configuration. | ||
|
|
||
| Preview results are displayed in the terminal. Use this to quickly validate | ||
| your configuration before running a full dataset creation. | ||
|
|
||
| By default, records are displayed one at a time in interactive mode. Use | ||
| --non-interactive to display all records at once (also used automatically | ||
|
Comment on lines
-56
to
-62
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. didn't realize the entire docstring prints on --help |
||
| when output is piped). | ||
|
|
||
| Examples: | ||
| # Preview from a YAML config | ||
| data-designer preview my_config.yaml | ||
|
|
||
| # Preview from a Python module | ||
| data-designer preview my_config.py | ||
|
|
||
| # Preview with custom number of records | ||
| data-designer preview my_config.yaml --num-records 5 | ||
|
|
||
| # Preview from a remote config URL | ||
| data-designer preview https://example.com/my_config.yaml | ||
|
|
||
| # Display all records without interactive browsing | ||
| data-designer preview my_config.yaml --non-interactive | ||
|
|
||
| # Save preview results to disk | ||
| data-designer preview my_config.yaml --save-results | ||
|
|
||
| # Save results to a custom path | ||
| data-designer preview my_config.yaml --save-results --artifact-path ./output | ||
|
|
||
| # Save results with light theme | ||
| data-designer preview my_config.yaml --save-results --theme light | ||
| """ | ||
| """Generate a preview dataset for fast iteration on your configuration.""" | ||
| controller = GenerationController() | ||
| controller.run_preview( | ||
| config_source=config_source, | ||
|
|
||
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't print to the terminal when --save-results is passed