Skip to content

Commit ceaf9e7

Browse files
committed
refactor(typing): Factor out another pair
1 parent 43ceb3f commit ceaf9e7

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

narwhals/translate.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ class LazyAllow(TypedDict):
151151
allow_series: NotRequired[bool | None]
152152

153153

154+
class EagerLazySeriesAllow(TypedDict):
155+
pass_through: NotRequired[bool]
156+
eager_only: NotRequired[Literal[False]]
157+
series_only: NotRequired[Literal[False]]
158+
allow_series: Literal[True]
159+
160+
154161
@overload
155162
def from_native(native_object: SeriesT, **kwds: Any) -> SeriesT: ...
156163

@@ -218,25 +225,10 @@ def from_native(
218225
@overload
219226
def from_native(
220227
native_object: IntoDataFrameT | IntoLazyFrameT | IntoSeriesT,
221-
*,
222-
pass_through: Literal[True],
223-
eager_only: Literal[False] = ...,
224-
series_only: Literal[False] = ...,
225-
allow_series: Literal[True],
228+
**kwds: Unpack[EagerLazySeriesAllow],
226229
) -> DataFrame[IntoDataFrameT] | LazyFrame[IntoLazyFrameT] | Series[IntoSeriesT]: ...
227230

228231

229-
@overload
230-
def from_native(
231-
native_object: IntoFrame | IntoSeries,
232-
*,
233-
pass_through: Literal[False] = ...,
234-
eager_only: Literal[False] = ...,
235-
series_only: Literal[False] = ...,
236-
allow_series: Literal[True],
237-
) -> DataFrame[Any] | LazyFrame[Any] | Series[Any]: ...
238-
239-
240232
# All params passed in as variables
241233
@overload
242234
def from_native(

0 commit comments

Comments
 (0)