You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[1.4.1 regression] In the downstream projects, running mypy . --install-types attempts to install types-tensorflow, even though tensorflow is unused and not installed #194
The stubs include tensorflow types for the tf functions: def tf(*, connection: DuckDBPyConnection | None = None) -> dict[str, tensorflow.Tensor]. My guess is that this is why mypy tries to install them?
Fixed in #323. Removed the tensorflow and torch imports from the TYPE_CHECKING block. The return types of .tf() and .torch() now use Any instead of tensorflow.Tensor / pytorch.Tensor. This means downstream projects won't get prompted to install types-tensorflow when running mypy --install-types. The trade-off is that callers lose the Tensor return type. My guess is that these are niche methods. Let's see whether I'm right about this.
Activity
evertlammerts commentedon Dec 6, 2025
The stubs include tensorflow types for the
tffunctions:def tf(*, connection: DuckDBPyConnection | None = None) -> dict[str, tensorflow.Tensor]. My guess is that this is why mypy tries to install them?evertlammerts commentedon Feb 17, 2026
Fixed in #323. Removed the tensorflow and torch imports from the
TYPE_CHECKINGblock. The return types of .tf() and .torch() now useAnyinstead oftensorflow.Tensor/pytorch.Tensor. This means downstream projects won't get prompted to install types-tensorflow when running mypy --install-types. The trade-off is that callers lose the Tensor return type. My guess is that these are niche methods. Let's see whether I'm right about this.Fix multiple stub issues (#323)