Skip to content

Commit 5a1ec57

Browse files
authored
chore(typing): remove unused, ignored TypeVar (#2108)
chore(typing): remove unused ignored `TypeVar` - Was planning to replace with `nw.typing.FrameT`, but noticed there was no usage - Also lets us move some imports into `TYPE_CHECKING`
1 parent bbb520b commit 5a1ec57

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

narwhals/functions.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
from typing import Mapping
1010
from typing import Protocol
1111
from typing import Sequence
12-
from typing import TypeVar
13-
from typing import Union
1412
from typing import overload
1513

1614
from narwhals._expression_parsing import ExprKind
@@ -21,8 +19,6 @@
2119
from narwhals._expression_parsing import extract_compliant
2220
from narwhals._expression_parsing import infer_kind
2321
from narwhals._expression_parsing import is_scalar_like
24-
from narwhals.dataframe import DataFrame
25-
from narwhals.dataframe import LazyFrame
2622
from narwhals.dependencies import is_numpy_array
2723
from narwhals.dependencies import is_numpy_array_2d
2824
from narwhals.expr import Expr
@@ -39,19 +35,15 @@
3935
from narwhals.utils import validate_laziness
4036
from narwhals.utils import validate_native_namespace_and_backend
4137

42-
# Missing type parameters for generic type "DataFrame"
43-
# However, trying to provide one results in mypy still complaining...
44-
# The rest of the annotations seem to work fine with this anyway
45-
FrameT = TypeVar("FrameT", bound=Union[DataFrame, LazyFrame]) # type: ignore[type-arg]
46-
47-
4838
if TYPE_CHECKING:
4939
from types import ModuleType
5040

5141
import polars as pl
5242
import pyarrow as pa
5343
from typing_extensions import Self
5444

45+
from narwhals.dataframe import DataFrame
46+
from narwhals.dataframe import LazyFrame
5547
from narwhals.dtypes import DType
5648
from narwhals.series import Series
5749
from narwhals.typing import CompliantExpr

0 commit comments

Comments
 (0)