Open
Conversation
Comment on lines
+964
to
+966
| # Display final status | ||
| transformed_data = transform_session_response(final_response) | ||
| format_stop_success_output(transformed_data, wait=True) |
There was a problem hiding this comment.
Bug: The pause_session command with --wait passes incorrectly structured data to format_stop_success_output, causing the success message to display incorrect session details.
Severity: MEDIUM
Suggested Fix
Update format_stop_success_output to handle the transformed data structure, using the keys id, cost, and runtime. Alternatively, pass the raw, untransformed API response to format_stop_success_output within the pause_session function.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: cloudos_cli/interactive_session/cli.py#L964-L966
Potential issue: When the `cloudos interactive-session pause --wait` command is used,
the `pause_session` function passes transformed data to the `format_stop_success_output`
function. However, `format_stop_success_output` expects raw API response data. It
attempts to access keys like `_id`, `totalCostInUsd`, and `totalRunningTimeInSeconds`,
but the transformed data contains `id`, `cost`, and `runtime` instead. This mismatch
causes the success message to display incorrect information, showing the Session ID as
"Unknown", Total Cost as "$0.00", and an incorrect runtime.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements the
cloudos interactive-session pausecommandJIRA
https://lifebit.atlassian.net/browse/LP-105730
Changes
pausecommandAcceptance Criteria
Scenario 1: Successfully pause a running IA session
#### JupyterRstudio
spark
check status
Scenario 2: Attempt to pause an already paused session
Scenario 3: Force pause a session
Scenario 4: Attempt to pause a session with a non-existent session ID