Skip to content

fix: initialize status variable before loop in wait_for_app#150

Draft
hussein-awala wants to merge 1 commit intomainfrom
fix/unbound-status-on-api-exception
Draft

fix: initialize status variable before loop in wait_for_app#150
hussein-awala wants to merge 1 commit intomainfrom
fix/unbound-status-on-api-exception

Conversation

@hussein-awala
Copy link
Owner

Summary

  • In both SparkAppManager.wait_for_app and AsyncSparkAppManager.wait_for_app, if app_status() raises a non-404 ApiException on the first loop iteration, the status variable was never assigned
  • This caused a NameError when the code tried to log the status after the except block
  • Fixed by initializing status to SparkAppStatus.Unknown before the loop

Test plan

  • Verify wait_for_app handles non-404 ApiException on first iteration without crashing
  • Verify normal wait_for_app flow still works correctly

🤖 Generated with Claude Code

If app_status() raises a non-404 ApiException on the first iteration,
the status variable was never assigned, causing a NameError when
logging. Initialize to SparkAppStatus.Unknown before the loop.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant