prefect icon indicating copy to clipboard operation
prefect copied to clipboard

Handle state parameter case in CLI `flow-run ls`

Open NodeJSmith opened this issue 1 year ago • 3 comments

First check

  • [X] I added a descriptive title to this issue.
  • [X] I used the GitHub search to find a similar request and didn't find it.
  • [X] I searched the Prefect documentation for this feature.

Prefect Version

2.x

Describe the current behavior

When running prefect flow-run ls --state RUNNING you do not get back running flows. If you run prefect flow-run ls --state Running you do. However, if you run prefect flow-run ls --state-type RUNNING you get running flows and if you run prefect-flow-run ls --state-type Running you get an error.

Describe the proposed behavior

It would be great if the CLI could adjust these arguments on behalf of the user, converting running or Running to RUNNING for the --state-type argument and converting RUNNING to Running for the --state argument.

Example Use

Ideally prefect flow-run ls --state RUNNING and prefect flow-run ls --state Running would return the same response.

Additional context

This would just be more user friendly, especially since the same basic argument value is currently required to be in a different case for --state and --state-type.

NodeJSmith avatar Jan 30 '24 23:01 NodeJSmith

Oh, another frustration, the State column shows the values in all uppercase, even when running with --state Running, which makes it very easy to assume that uppercase is required when it actually doesn't work.

NodeJSmith avatar Jan 30 '24 23:01 NodeJSmith

thanks for the issue @NodeJSmith! we've added this to the backlog

zzstoatzz avatar Jan 31 '24 00:01 zzstoatzz

@NodeJSmith, this casing may be causing a lot of frustration while using the CLI. Thanks for raising this issue. @zzstoatzz, can you please assign this issue to me?

thedevhaider avatar Feb 02 '24 06:02 thedevhaider