Skip to content

Commit

Permalink
fix(typing): Use correct TypeVar/Union pairs in from_native (#1935
Browse files Browse the repository at this point in the history
)

Resolves 4x `pyright` warnings
  • Loading branch information
dangotbanned authored Feb 4, 2025
1 parent 4f276c5 commit a2ff411
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions narwhals/translate.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
from narwhals.dataframe import LazyFrame
from narwhals.series import Series
from narwhals.typing import IntoDataFrameT
from narwhals.typing import IntoFrame
from narwhals.typing import IntoFrameT
from narwhals.typing import IntoSeries
from narwhals.typing import IntoSeriesT
Expand Down Expand Up @@ -129,7 +130,7 @@ def to_native(

@overload
def from_native(
native_object: IntoDataFrameT | IntoSeriesT,
native_object: IntoDataFrameT | IntoSeries,
*,
pass_through: Literal[True],
eager_only: Literal[False] = ...,
Expand Down Expand Up @@ -239,7 +240,7 @@ def from_native(

@overload
def from_native(
native_object: IntoFrameT | IntoSeriesT,
native_object: IntoFrame | IntoSeries,
*,
pass_through: Literal[False] = ...,
eager_only: Literal[False] = ...,
Expand Down Expand Up @@ -283,7 +284,7 @@ def from_native(


def from_native(
native_object: IntoFrameT | IntoSeries | T,
native_object: IntoFrameT | IntoSeriesT | IntoFrame | IntoSeries | T,
*,
strict: bool | None = None,
pass_through: bool | None = None,
Expand Down

0 comments on commit a2ff411

Please sign in to comment.