Commit 140990b
committed
Warn (don't raise) on unknown auth values during CSV import
Post-merge follow-up on #1811 -- the strict behavior it introduced
(create_user_from_line raises ValueError on any auth value not in
_AUTH_CANONICAL) would block CSV imports against newer servers as
soon as Tableau ships an auth type TSC's hardcoded list doesn't yet
know about. This is the same category of stale-list problem the
_set_values enum-guard bypass exists to avoid on the server-parse
path.
Both entry points now warn and pass the value through:
- create_user_from_line: unknown values raise a UserWarning naming
the value and known set, then get assigned to auth_setting as-is.
If the value really is a typo, the server rejects the row when
the request posts -- a slightly-later error, but the import stays
possible against forward-compatible servers.
- _validate_import_line_or_throw: same shape. Skips the allowlist
check for the AUTH column when the value isn't in _AUTH_CANONICAL,
so validate_file_for_import doesn't return the row as invalid.
Server-version-aware validation would be the cleaner long-term fix
here (and for the enum-guard bypass in _set_values); noted for
planning, not filing an issue.
Tests updated: two former "raises ValueError" cases now assert
pytest.warns(UserWarning) and confirm the raw value round-trips
onto UserItem.auth_setting.1 parent 275afdc commit 140990b
2 files changed
Lines changed: 58 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
476 | 477 | | |
477 | 478 | | |
478 | 479 | | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
483 | | - | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
484 | 493 | | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
485 | 497 | | |
486 | 498 | | |
487 | 499 | | |
| |||
546 | 558 | | |
547 | 559 | | |
548 | 560 | | |
| 561 | + | |
549 | 562 | | |
| 563 | + | |
550 | 564 | | |
551 | 565 | | |
552 | | - | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
553 | 583 | | |
554 | 584 | | |
555 | | - | |
556 | | - | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
557 | 590 | | |
558 | 591 | | |
559 | 592 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
212 | 219 | | |
213 | 220 | | |
214 | 221 | | |
| |||
218 | 225 | | |
219 | 226 | | |
220 | 227 | | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
227 | 233 | | |
228 | 234 | | |
229 | 235 | | |
| |||
0 commit comments