46 lines
1.5 KiB
Markdown
46 lines
1.5 KiB
Markdown
---
|
|
id: ad48fe50-12a6-4c65-a49c-3a691d75e03f
|
|
type: solution
|
|
title: "Rust CSV importer integration tested — matches Python DB exactly"
|
|
tags: [sba-scout, rust, importer, csv, testing, integration-test]
|
|
importance: 0.7
|
|
confidence: 0.8
|
|
created: "2026-02-28T18:09:42.807948+00:00"
|
|
updated: "2026-02-28T18:10:05.594987+00:00"
|
|
relations:
|
|
- target: 71261e95-805e-44a0-8ee2-4a0f683dbc1f
|
|
type: RELATED_TO
|
|
direction: outgoing
|
|
strength: 0.85
|
|
edge_id: 594e81c0-2c76-4412-8513-157d7daa92e3
|
|
---
|
|
|
|
# Rust CSV importer integration tested — matches Python DB exactly
|
|
|
|
## Context
|
|
|
|
The Rust CSV card importer (`api/importer.rs`) had unit tests for parse helpers but no integration test against real CSV data. The Rust DB previously had 0 cards because the importer had never been run against actual files.
|
|
|
|
## Test Run
|
|
|
|
1. Copied `BatterCalcs.csv` and `PitcherCalcs.csv` to `rust/docs/sheets_export/`
|
|
2. Ran `import_all_cards()` against the Rust DB (`rust/data/sba_scout.db`)
|
|
|
|
## Results
|
|
|
|
| Type | Cards Imported | Errors |
|
|
|---------|---------------|--------|
|
|
| Batter | 490 | 0 |
|
|
| Pitcher | 502 | 0 |
|
|
|
|
Identical to Python DB row counts. Sample values verified (Rutschman batter card, Ben Brown pitcher card).
|
|
|
|
## Committed
|
|
|
|
CSVs committed to repo at `rust/docs/sheets_export/`.
|
|
|
|
## Key Notes
|
|
|
|
- Default CSV paths are relative to `rust/` cwd: `docs/sheets_export/BatterCalcs.csv` and `docs/sheets_export/PitcherCalcs.csv`
|
|
- The Rust app uses `rust/data/sba_scout.db` (separate from Python's `data/sba_scout.db`)
|