Skip to content
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

fix(framework) Suppress output when in JSON format for flwr ls #4734

Merged
merged 3 commits into from
Dec 17, 2024

Conversation

chongshenng
Copy link
Contributor

@chongshenng chongshenng commented Dec 17, 2024

The flwr ls command raises a ValueError on this line if a run ID is not found. This won't be suppressed because the call to restore_output is made before the ValueError is raised. This PR fixes this for flwr ls.

To reproduce, run flwr ls 123 --format json before and after the fix.

➜ flwr ls --run-id 123 --format json
❌ Run ID 123 not found
{
  "success": false,
  "error-message": "Loading project configuration... \nSuccess\n Displaying information for run ID 123...\n\n"
}

and after:

➜ flwr ls --run-id 123 --format json
{
  "success": false,
  "error-message": "Loading project configuration... \nSuccess\n Displaying information for run ID 123...\n Run ID 123 not found\n\n"
}

Copy link
Contributor

@panh99 panh99 left a comment

Choose a reason for hiding this comment

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

LGTM!

@chongshenng chongshenng marked this pull request as ready for review December 17, 2024 15:47
@danieljanes danieljanes enabled auto-merge (squash) December 17, 2024 19:40
@danieljanes danieljanes merged commit b214ab9 into main Dec 17, 2024
55 checks passed
@danieljanes danieljanes deleted the fix-ls-json branch December 17, 2024 19:54
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