Skip to content

fix(benchmarks): handle EOF when selecting models without -m#1013

Open
sridipbasu wants to merge 1 commit into
Kaggle:mainfrom
sridipbasu:fix-benchmarks-eof-input
Open

fix(benchmarks): handle EOF when selecting models without -m#1013
sridipbasu wants to merge 1 commit into
Kaggle:mainfrom
sridipbasu:fix-benchmarks-eof-input

Conversation

@sridipbasu
Copy link
Copy Markdown

Summary

Handle EOFError during interactive benchmark model selection to improve behavior in non-interactive environments.

Previously, running:

kaggle benchmarks tasks run <task>

without -m/--model could fail ambiguously or hang when stdin was unavailable (for example in CI or other non-interactive environments).

This change:

  • wraps the interactive input() call in try/except EOFError
  • raises a clear ValueError instructing users to pass -m/--model
  • preserves existing piped stdin behavior (e.g. echo 1 | ...)

Changes

  • Updated _select_models_interactively in kaggle_api_extended.py

  • Added tests for:

    • EOF/non-interactive stdin behavior
    • piped stdin compatibility

Test Plan

pytest src/kaggle/test/test_benchmarks_cli.py::TestRun

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