Repository navigation
Commit bf26357
mypy + lint cleanup across buffered_table touched files
The recent buffered_table refactor touched files (worker.py,
function_storage.py, function_storage_azure_sql.py, _test_fixtures/
table_in_out.py, table_in_out_function.py) had accumulated mypy and
ruff debt — pre-existing in some places, newly introduced by the B.1
helper in others. This commit clears the slate:
* table_in_out_function.py: declare ``state_class`` and ``combine`` on
the ``TableInOutGenerator`` base class so subclasses on the buffered
path don't need ``# type: ignore[attr-defined]`` on every callsite.
state_class is constrained to ``type[ArrowSerializableDataclass] | None``
so callers can invoke ``serialize_to_bytes`` / ``deserialize_from_bytes``
without further narrowing.
* worker.py: add a runtime ``issubclass`` narrowing in
``_load_buffered_table_params`` so mypy sees the resolver returning a
``type[TableInOutGenerator[Any, Any]]``. Annotate the hot ``state``
variable as ``Any`` (alternates between ArrowSerializableDataclass
and whatever ``initial_state()`` returns). Fix unused-ignore comments.
Document the two genuine type-ignores at the duck-typed buffered call
sites (NoOpCollector → OutputCollector; widened finalize signature).
* _test_fixtures/table_in_out.py: ``# type: ignore[override]`` on the
buffered-shape ``finalize(finalize_state_id, params)`` overrides
(deliberate signature widening from the streaming-shape
``finalize(params)`` base) — with comments explaining why the worker's
``Meta.buffered_table=True`` routing makes this safe at runtime.
Remove now-unused ``# type: ignore[override]`` on ``combine`` /
``process`` (the base-class additions made them resolvable). Fix
three ``zip()`` strict= warnings and a docstring summary line.
* function_storage_azure_sql.py: cast pymssql cursor values through
``Any`` before ``bytes()`` / ``int()`` (cursor's typed-row shim
returns a broad union; we know the column is binary / int from the
schema).
Test result: ``test_mypy_vgi_clean`` now passes (was the long-standing
baseline failure). Full vgi-python suite: 30 failed / 1652 passed (one
fewer baseline failure than before).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 19b3b5c commit bf26357
4 files changed
Lines changed: 134 additions & 43 deletions
File tree
- vgi
- _test_fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
221 | 230 | | |
222 | 231 | | |
223 | 232 | | |
| |||
552 | 561 | | |
553 | 562 | | |
554 | 563 | | |
555 | | - | |
| 564 | + | |
| 565 | + | |
556 | 566 | | |
557 | 567 | | |
558 | 568 | | |
| |||
564 | 574 | | |
565 | 575 | | |
566 | 576 | | |
567 | | - | |
| 577 | + | |
568 | 578 | | |
569 | 579 | | |
570 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
571 | 586 | | |
572 | 587 | | |
573 | 588 | | |
574 | 589 | | |
575 | 590 | | |
576 | 591 | | |
577 | | - | |
| 592 | + | |
578 | 593 | | |
579 | 594 | | |
580 | 595 | | |
| |||
596 | 611 | | |
597 | 612 | | |
598 | 613 | | |
599 | | - | |
600 | | - | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
601 | 619 | | |
602 | 620 | | |
603 | 621 | | |
| |||
620 | 638 | | |
621 | 639 | | |
622 | 640 | | |
623 | | - | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
624 | 647 | | |
625 | 648 | | |
626 | 649 | | |
627 | 650 | | |
628 | 651 | | |
629 | 652 | | |
630 | | - | |
| 653 | + | |
631 | 654 | | |
632 | 655 | | |
633 | 656 | | |
| |||
640 | 663 | | |
641 | 664 | | |
642 | 665 | | |
643 | | - | |
| 666 | + | |
644 | 667 | | |
645 | 668 | | |
646 | 669 | | |
| |||
662 | 685 | | |
663 | 686 | | |
664 | 687 | | |
665 | | - | |
| 688 | + | |
666 | 689 | | |
667 | 690 | | |
668 | 691 | | |
| |||
812 | 835 | | |
813 | 836 | | |
814 | 837 | | |
815 | | - | |
| 838 | + | |
816 | 839 | | |
817 | 840 | | |
818 | 841 | | |
| |||
838 | 861 | | |
839 | 862 | | |
840 | 863 | | |
841 | | - | |
| 864 | + | |
842 | 865 | | |
843 | 866 | | |
844 | 867 | | |
| |||
862 | 885 | | |
863 | 886 | | |
864 | 887 | | |
865 | | - | |
| 888 | + | |
866 | 889 | | |
867 | 890 | | |
868 | 891 | | |
| |||
879 | 902 | | |
880 | 903 | | |
881 | 904 | | |
882 | | - | |
| 905 | + | |
883 | 906 | | |
884 | 907 | | |
885 | 908 | | |
| |||
891 | 914 | | |
892 | 915 | | |
893 | 916 | | |
894 | | - | |
895 | | - | |
896 | | - | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
897 | 921 | | |
898 | 922 | | |
899 | 923 | | |
| |||
942 | 966 | | |
943 | 967 | | |
944 | 968 | | |
945 | | - | |
| 969 | + | |
946 | 970 | | |
947 | 971 | | |
948 | | - | |
| 972 | + | |
949 | 973 | | |
950 | 974 | | |
951 | 975 | | |
| |||
1068 | 1092 | | |
1069 | 1093 | | |
1070 | 1094 | | |
1071 | | - | |
| 1095 | + | |
1072 | 1096 | | |
1073 | 1097 | | |
| 1098 | + | |
1074 | 1099 | | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
1080 | 1106 | | |
1081 | 1107 | | |
1082 | 1108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
431 | 432 | | |
432 | 433 | | |
433 | 434 | | |
434 | | - | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
435 | 441 | | |
436 | 442 | | |
437 | 443 | | |
| |||
514 | 520 | | |
515 | 521 | | |
516 | 522 | | |
517 | | - | |
| 523 | + | |
518 | 524 | | |
519 | 525 | | |
520 | 526 | | |
| |||
545 | 551 | | |
546 | 552 | | |
547 | 553 | | |
548 | | - | |
| 554 | + | |
549 | 555 | | |
550 | 556 | | |
551 | 557 | | |
| |||
561 | 567 | | |
562 | 568 | | |
563 | 569 | | |
564 | | - | |
| 570 | + | |
565 | 571 | | |
566 | 572 | | |
567 | 573 | | |
| |||
648 | 654 | | |
649 | 655 | | |
650 | 656 | | |
| 657 | + | |
| 658 | + | |
651 | 659 | | |
652 | | - | |
| 660 | + | |
653 | 661 | | |
654 | 662 | | |
655 | 663 | | |
| |||
659 | 667 | | |
660 | 668 | | |
661 | 669 | | |
662 | | - | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
663 | 673 | | |
664 | 674 | | |
665 | 675 | | |
| |||
686 | 696 | | |
687 | 697 | | |
688 | 698 | | |
689 | | - | |
| 699 | + | |
690 | 700 | | |
691 | 701 | | |
692 | 702 | | |
| |||
| 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 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
60 | 85 | | |
61 | 86 | | |
62 | 87 | | |
| |||
0 commit comments