Commit 9c96bd7
Document and validate required schema table names for create_connection
The schema argument requires specific TulipaEnergyModel-convention table names
(asset, asset_both, asset_commission, asset_milestone, flow, flow_both,
flow_commission, flow_milestone). Previously this contract was implicit and
callers got cryptic KeyErrors on mismatch.
- Add `_REQUIRED_SCHEMA_TABLES` const and `_validate_schema` validator
- Throw `ArgumentError` with clear message listing missing tables
- Update `create_connection` docstring to document required schema structure
- Update README schema-driven design bullet with required table names
- Add test verifying ArgumentError is thrown for incomplete schemas
Co-authored-by: Claude Code (claude-sonnet-4-6) <noreply@anthropic.com>1 parent f81634a commit 9c96bd7
3 files changed
Lines changed: 79 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
3 | 37 | | |
4 | 38 | | |
5 | 39 | | |
| |||
147 | 181 | | |
148 | 182 | | |
149 | 183 | | |
150 | | - | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
151 | 199 | | |
152 | 200 | | |
153 | 201 | | |
| 202 | + | |
154 | 203 | | |
155 | 204 | | |
156 | 205 | | |
| |||
468 | 517 | | |
469 | 518 | | |
470 | 519 | | |
| 520 | + | |
471 | 521 | | |
472 | 522 | | |
473 | 523 | | |
| |||
527 | 577 | | |
528 | 578 | | |
529 | 579 | | |
| 580 | + | |
530 | 581 | | |
531 | 582 | | |
532 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
6 | 28 | | |
7 | 29 | | |
8 | 30 | | |
| |||
0 commit comments