-
Notifications
You must be signed in to change notification settings - Fork 58
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
SNOW-986249-console-output-tools: cli_console for intermediate output #659
Conversation
275a283
to
f36855c
Compare
975b465
to
790c90e
Compare
813710e
to
a3b98b3
Compare
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.
Good to see this feature implemented, it will greatly improve the usability of NADE tools.
a3b98b3
to
e52a5e9
Compare
928ece5
to
055efbd
Compare
3a0eb87
to
c768626
Compare
…CliConsole and AbstractConsole
… added error output type
…e type to Optional str with default
35641a8
to
00b2ca4
Compare
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.
API looks good, minor comments about docs & tests
def test_step_indented_in_phase(cli_console, capsys): | ||
with cli_console.phase("42"): | ||
cli_console.step("73") | ||
assert_output_matches("42\n 73\n", capsys) |
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.
nit: for readability, I'd probably modify the helper so that it accepts individual lines instead. For simple examples it's not too bad, but more complex ones are tricky to read quickly.
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.
IMO more complex ones should be handled with syrupy
snapshots.
6a63c1d
to
f574219
Compare
with cc.phase("Long sequence of actions"): | ||
cc.step("Phased step 1") | ||
cc.step("Phased step 2") | ||
if something_important: | ||
cc.warning("It's important") | ||
cc.step("Final step") |
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.
Let's add business logic to this example to show how it should relate with steps and phases. WDYT?
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.
I'll submit update in separate PR 👍
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.
LGTM! One small comment
SNOW-986249
Pre-review checklist
Changes description
snowflake.cli.api.output
package introducessnow_cli
object for displaying console intermediate outputphase
andstep
provide displaying output to consolestep
method for displaying messages to userswarning
method for displaying important messages to usersphase
method for grouping messages in distinctive way