Commit 0872ba7
fix: do not construct IntEnum for unknown dtype/selector_mode
_RoutingDtype(int) and _SelectorMode(int) raise ValueError for any
value not in the enum, so the .get() fallback was unreachable: a
future routing_dtype=3 in the header would crash metadata
construction before str(int) could run.
Look up names by raw int instead — IntEnum keys hash-equal their int
values, so known modes resolve to their lowercase name and unknown
ones fall back to str(int) without ever constructing the enum.
Adds a regression test exercising routing_dtype=99.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent 1faadd5 commit 0872ba7
2 files changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
186 | | - | |
187 | | - | |
| 182 | + | |
| 183 | + | |
188 | 184 | | |
189 | 185 | | |
190 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
269 | 283 | | |
270 | 284 | | |
271 | 285 | | |
| |||
0 commit comments