Skip to content

add -o json option to cost-report#9504

Open
MaxVanDijck wants to merge 4 commits intoskypilot-org:masterfrom
MaxVanDijck:add-json-output-cost-report
Open

add -o json option to cost-report#9504
MaxVanDijck wants to merge 4 commits intoskypilot-org:masterfrom
MaxVanDijck:add-json-output-cost-report

Conversation

@MaxVanDijck
Copy link
Copy Markdown

@MaxVanDijck MaxVanDijck commented Apr 30, 2026

adds a -o json output for the cost-report cli to address #9499 (comment)

Added unittests for the new json output which are similar to the other unittests for json output

Tested (run the relevant ones):

  • Code formatting: install pre-commit (auto-check on commit) or bash format.sh
  • Any manual or new tests for this PR (please specify below)
  • All smoke tests: /smoke-test (CI) or pytest tests/test_smoke.py (local)
  • Relevant individual tests: /smoke-test -k test_name (CI) or pytest tests/test_smoke.py::test_name (local)
  • Backward compatibility: /quicktest-core (CI) or pytest tests/smoke_tests/test_backward_compat.py (local)

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements JSON output support for the sky cost-report command, including the necessary CLI flag and logic to format cluster records as JSON. It also adds comprehensive unit tests to verify the new functionality. Review feedback suggests moving a pylint suppression comment to the correct parameter and providing a default value for the output_format argument to ensure consistency when the function is called programmatically.

Comment thread sky/client/cli/command.py Outdated
Comment thread sky/client/cli/command.py Outdated
Copy link
Copy Markdown
Collaborator

@Michaelvll Michaelvll left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @MaxVanDijck! It looks mostly good to me, except for the resource output format (see comment below)

Comment thread sky/client/cli/command.py Outdated
@MaxVanDijck MaxVanDijck requested a review from Michaelvll May 6, 2026 01:07
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.

2 participants