Skip to content

Commit 1cab6d0

Browse files
committed
refactor: Invert NotRequired -> Required
wayyy more common in this case
1 parent cc5588b commit 1cab6d0

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

narwhals/translate.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
)
3131

3232
if TYPE_CHECKING:
33-
from typing_extensions import NotRequired, Unpack
33+
from typing_extensions import Required, Unpack
3434

3535
from narwhals.dataframe import DataFrame, LazyFrame
3636
from narwhals.series import Series
@@ -108,46 +108,46 @@ class SeriesNever(TypedDict, total=False):
108108
allow_series: Literal[False] | None
109109

110110

111-
class SeriesAllow(TypedDict):
112-
pass_through: NotRequired[bool]
113-
eager_only: NotRequired[bool]
114-
series_only: NotRequired[Literal[False]]
115-
allow_series: Literal[True]
111+
class SeriesAllow(TypedDict, total=False):
112+
pass_through: bool
113+
eager_only: bool
114+
series_only: Literal[False]
115+
allow_series: Required[Literal[True]]
116116

117117

118-
class SeriesOnly(TypedDict):
119-
pass_through: NotRequired[bool]
120-
eager_only: NotRequired[bool]
121-
series_only: Literal[True]
122-
allow_series: NotRequired[bool | None]
118+
class SeriesOnly(TypedDict, total=False):
119+
pass_through: bool
120+
eager_only: bool
121+
series_only: Required[Literal[True]]
122+
allow_series: bool | None
123123

124124

125-
class EagerOnly(TypedDict):
126-
pass_through: NotRequired[bool]
127-
eager_only: Literal[True]
128-
series_only: NotRequired[bool]
129-
allow_series: NotRequired[bool | None]
125+
class EagerOnly(TypedDict, total=False):
126+
pass_through: bool
127+
eager_only: Required[Literal[True]]
128+
series_only: bool
129+
allow_series: bool | None
130130

131131

132-
class LazyAllow(TypedDict):
133-
pass_through: NotRequired[bool]
134-
eager_only: NotRequired[Literal[False]]
135-
series_only: NotRequired[Literal[False]]
136-
allow_series: NotRequired[bool | None]
132+
class LazyAllow(TypedDict, total=False):
133+
pass_through: bool
134+
eager_only: Literal[False]
135+
series_only: Literal[False]
136+
allow_series: bool | None
137137

138138

139-
class EagerLazySeriesAllow(TypedDict):
140-
pass_through: NotRequired[bool]
141-
eager_only: NotRequired[Literal[False]]
142-
series_only: NotRequired[Literal[False]]
143-
allow_series: Literal[True]
139+
class EagerLazySeriesAllow(TypedDict, total=False):
140+
pass_through: bool
141+
eager_only: Literal[False]
142+
series_only: Literal[False]
143+
allow_series: Required[Literal[True]]
144144

145145

146-
class PassThroughUnknown(TypedDict):
147-
pass_through: Literal[True]
148-
eager_only: NotRequired[bool]
149-
series_only: NotRequired[bool]
150-
allow_series: NotRequired[bool | None]
146+
class PassThroughUnknown(TypedDict, total=False):
147+
pass_through: Required[Literal[True]]
148+
eager_only: bool
149+
series_only: bool
150+
allow_series: bool | None
151151

152152

153153
@overload

0 commit comments

Comments
 (0)