Skip to content

Fix CSV export for empty result sets#11

Closed
GHX5T-SOL wants to merge 1 commit into
PracticalMind:mainfrom
GHX5T-SOL:fix/8-export-empty-results
Closed

Fix CSV export for empty result sets#11
GHX5T-SOL wants to merge 1 commit into
PracticalMind:mainfrom
GHX5T-SOL:fix/8-export-empty-results

Conversation

@GHX5T-SOL
Copy link
Copy Markdown

Summary

  • Fix CSV export when every model call fails and export() receives no records.
  • Use the exporter schema as the CSV field list instead of deriving headers from records[0].
  • Add regression coverage for empty CSV exports writing the header row and no data rows.

Fixes #8.

Validation

  • python3 -m pytest tests/test_exporter.py -q -> 8 passed, 1 warning
  • uv run --with pytest --with pytest-asyncio --with ruff --with numpy pytest -q -> 40 passed, 4 skipped
  • uv run --with pytest --with pytest-asyncio --with ruff --with numpy ruff check . -> All checks passed
  • git diff --check
  • git diff | gitleaks stdin --no-banner --redact --timeout 30 -> no leaks found
  • Direct smoke: export([], temp_csv) writes only the CSV header row

Notes

I could not use the declared full dev extra on this host because it resolves to torch==2.12.0, which has no compatible macOS x86_64 wheel here. I used the minimal test/lint dependencies needed for the local test suite instead.

@GHX5T-SOL
Copy link
Copy Markdown
Author

Closing this as duplicate/stale. PR #10 was merged earlier and resolves #8, so this branch is no longer needed.

@GHX5T-SOL GHX5T-SOL closed this May 18, 2026
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.

Export() raises IndexError when all model calls fail

1 participant