Skip to content

Commit 84006d9

Browse files
rustyconoverclaude
andcommitted
fix(typing): re-export OutputCollector from the function modules
The documented examples import OutputCollector from the function-base modules (e.g. `from vgi.table_in_out_function import OutputCollector`, `from vgi.table_buffering_function import OutputCollector`). That works at runtime, but downstream projects type-checking with `mypy --strict` got: Module "vgi.table_in_out_function" does not explicitly export attribute "OutputCollector" [attr-defined] because the name was only imported from vgi_rpc.rpc, not listed in __all__. Add OutputCollector to __all__ in table_in_out_function and table_buffering_function (vgi.table_function already exported it), and in copy_from_function, whose abstract read() hook also receives an OutputCollector (moving its import out of the TYPE_CHECKING block so the re-export exists at runtime). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent d9f7875 commit 84006d9

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎vgi/copy_from_function.py‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@
3333

3434
from abc import abstractmethod
3535
from dataclasses import dataclass
36-
from typing import TYPE_CHECKING, ClassVar, final
36+
from typing import ClassVar, final
3737

3838
import pyarrow as pa
3939
from vgi_rpc import ArrowSerializableDataclass
40+
from vgi_rpc.rpc import OutputCollector
4041

4142
from vgi.invocation import BindResponse
4243
from vgi.table_function import (
@@ -46,10 +47,7 @@
4647
init_single_worker,
4748
)
4849

49-
if TYPE_CHECKING:
50-
from vgi_rpc.rpc import OutputCollector
51-
52-
__all__ = ["CopyFromFunction"]
50+
__all__ = ["CopyFromFunction", "OutputCollector"]
5351

5452

5553
@dataclass(kw_only=True)

‎vgi/table_buffering_function.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
pass
5555

5656
__all__ = [
57+
"OutputCollector",
5758
"TableBufferingFunction",
5859
"TableBufferingParams",
5960
]

‎vgi/table_in_out_function.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
pass
3636

3737
__all__ = [
38+
"OutputCollector",
3839
"TableInOutGenerator",
3940
"TableInOutFunction",
4041
"TableInOutFunctionStateNoOp",

0 commit comments

Comments
 (0)