Skip to content

Conversation

@nnellen
Copy link
Contributor

@nnellen nnellen commented Nov 18, 2025

Fix command fdb-utils list --filter.

Command typer.Options not compatible with typer.Options --filter. Thus, replace with typer.Arguments which is still optional.

Plus add new shortcut -f for --filter.

Copy link
Collaborator

@victoria-cherkas victoria-cherkas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While we are looking at this, I think it would be best practice to test that the list_all_values is called with expected values, in test_cli.py . You could mock list_all_values and just assert the call args based on the cli inputs.

def list_metadata(
show: Annotated[str, typer.Option(help='The keys to print, eg. "step,number,param"')] = "",
filter_values: Annotated[str, typer.Option("--filter", help='The metadata to filter results by, eg "date=20240624,time=0600".')] = ""
show: Annotated[str, typer.Argument(help='The keys to print, eg. "step,number,param"')] = "",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does typer.Argument not mean that we need to provide this? Or is it still optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to my research no, also the test is green. Thus, I think it is fine.
However to mock list_all_values sounds good.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True true thanks for pointing to that test.
Yes i think that would be really nice, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants