Skip to content

fix: resolve IndexError in exporter and add timeout flag to run command#10

Merged
practicalmind-dev merged 1 commit into
PracticalMind:mainfrom
vuxuan2098-droid:fix/exporter-indexerror-empty-results
May 18, 2026
Merged

fix: resolve IndexError in exporter and add timeout flag to run command#10
practicalmind-dev merged 1 commit into
PracticalMind:mainfrom
vuxuan2098-droid:fix/exporter-indexerror-empty-results

Conversation

@vuxuan2098-droid
Copy link
Copy Markdown

Fixes #8: exporter.py now uses a fixed _FIELDS constant instead of deriving field names from records[0].keys(), preventing IndexError when results list is empty. Added guard so CSV writer skips rows when there are no records.

Fixes #9: added --timeout option to the run CLI command (default 30s). Timeout is now passed through run_all() and _run_one() instead of using a hardcoded module-level _TIMEOUT constant.

Updated tests: added 3 new tests for empty-results export, updated test_run_one_records_timeout to pass timeout directly.

Fixes PracticalMind#8: exporter.py now uses a fixed _FIELDS constant instead of
deriving field names from records[0].keys(), preventing IndexError
when results list is empty. Added guard so CSV writer skips rows
when there are no records.

Fixes PracticalMind#9: added --timeout option to the run CLI command (default 30s).
Timeout is now passed through run_all() and _run_one() instead of
using a hardcoded module-level _TIMEOUT constant.

Updated tests: added 3 new tests for empty-results export, updated
test_run_one_records_timeout to pass timeout directly.
@practicalmind-dev
Copy link
Copy Markdown
Contributor

Thanks for the clean fixes and the tests, merging this in.

@practicalmind-dev practicalmind-dev merged commit ce3902a into PracticalMind:main May 18, 2026
2 checks passed
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.

Expose --timeout flag on the run command Export() raises IndexError when all model calls fail

2 participants