Repository navigation
Commit e83bcd2
committed
fix: drop TableLayout.to_dict rather than add strict-mypy debt
I added to_dict() for surface consistency and then checked the gates properly:
it added 8 errors under this package s strict mypy settings (dict[str, Any] plus
comprehensions over the pydantic key models), taking the file from the 158 on
main to 166.
The alternative -- hand-building the dict from named fields -- is Any-free but
silently drops any field a later spec adds to TablePartitionKey or TableSortKey,
which is exactly the silent-drop failure this whole feature exists to prevent.
So taking the reviewer s first option: no to_dict, with a comment recording why
the inconsistency is deliberate, so the next reader does not "fix" it. A caller
wanting dicts can map k.to_dict() itself.
Also collapses a nested `with` flagged by ruff.
Back to main s baseline exactly: mypy 158, ruff only the pre-existing long line
in test_request_timeout.py. 139 passed.1 parent 1312bd4 commit e83bcd2
2 files changed
Lines changed: 13 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
73 | 69 | | |
74 | 70 | | |
75 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
522 | 518 | | |
523 | 519 | | |
524 | 520 | | |
| |||
555 | 551 | | |
556 | 552 | | |
557 | 553 | | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
563 | 558 | | |
0 commit comments