Skip to content

Commit 16cefb3

Browse files
committed
refactor: Rename StoresVersion -> HasVersion
Discovered this convention *after* naming the original May as well differentiate better from the jump
1 parent 203e5ee commit 16cefb3

File tree

6 files changed

+12
-12
lines changed

6 files changed

+12
-12
lines changed

narwhals/_plan/compliant/column.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
from narwhals._plan.common import flatten_hash_safe
77
from narwhals._plan.compliant.typing import (
88
FrameT_contra,
9+
HasVersion,
910
LengthT,
1011
NamespaceT_co,
1112
R_co,
1213
SeriesT,
13-
StoresVersion,
1414
)
1515

1616
if TYPE_CHECKING:
@@ -85,7 +85,7 @@ def _length_required(
8585
return max_length if required else None
8686

8787

88-
class ExprDispatch(StoresVersion, Protocol[FrameT_contra, R_co, NamespaceT_co]):
88+
class ExprDispatch(HasVersion, Protocol[FrameT_contra, R_co, NamespaceT_co]):
8989
# NOTE: Needs to stay `covariant` and never be used as a parameter
9090
def __narwhals_namespace__(self) -> NamespaceT_co: ...
9191
@classmethod

narwhals/_plan/compliant/dataframe.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import TYPE_CHECKING, Any, Literal, Protocol, overload
44

55
from narwhals._plan.compliant.group_by import Grouped
6-
from narwhals._plan.compliant.typing import ColumnT_co, SeriesT, StoresVersion
6+
from narwhals._plan.compliant.typing import ColumnT_co, HasVersion, SeriesT
77
from narwhals._plan.typing import (
88
IntoExpr,
99
NativeDataFrameT,
@@ -34,7 +34,7 @@
3434
from narwhals.typing import IntoSchema
3535

3636

37-
class CompliantFrame(StoresVersion, Protocol[ColumnT_co, NativeFrameT]):
37+
class CompliantFrame(HasVersion, Protocol[ColumnT_co, NativeFrameT]):
3838
_native: NativeFrameT
3939

4040
def __narwhals_namespace__(self) -> Any: ...

narwhals/_plan/compliant/expr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from narwhals._plan.compliant.column import EagerBroadcast, SupportsBroadcast
66
from narwhals._plan.compliant.typing import (
77
FrameT_contra,
8+
HasVersion,
89
LengthT,
910
SeriesT,
1011
SeriesT_co,
11-
StoresVersion,
1212
)
1313
from narwhals._utils import Version
1414

@@ -27,7 +27,7 @@
2727
from narwhals._plan.expressions.boolean import IsBetween, IsFinite, IsNan, IsNull, Not
2828

2929

30-
class CompliantExpr(StoresVersion, Protocol[FrameT_contra, SeriesT_co]):
30+
class CompliantExpr(HasVersion, Protocol[FrameT_contra, SeriesT_co]):
3131
"""Everything common to `Expr`/`Series` and `Scalar` literal values."""
3232

3333
_evaluated: Any

narwhals/_plan/compliant/namespace.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
EagerScalarT_co,
1111
ExprT_co,
1212
FrameT,
13+
HasVersion,
1314
LazyExprT_co,
1415
LazyScalarT_co,
1516
ScalarT_co,
1617
SeriesT,
17-
StoresVersion,
1818
)
1919

2020
if TYPE_CHECKING:
@@ -30,7 +30,7 @@
3030
from narwhals.typing import ConcatMethod, NonNestedLiteral
3131

3232

33-
class CompliantNamespace(StoresVersion, Protocol[FrameT, ExprT_co, ScalarT_co]):
33+
class CompliantNamespace(HasVersion, Protocol[FrameT, ExprT_co, ScalarT_co]):
3434
@property
3535
def _expr(self) -> type[ExprT_co]: ...
3636
@property

narwhals/_plan/compliant/series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import TYPE_CHECKING, Any, Protocol
44

5-
from narwhals._plan.compliant.typing import StoresVersion
5+
from narwhals._plan.compliant.typing import HasVersion
66
from narwhals._plan.typing import NativeSeriesT
77
from narwhals._utils import Version
88

@@ -16,7 +16,7 @@
1616
from narwhals.typing import Into1DArray, IntoDType, _1DArray
1717

1818

19-
class CompliantSeries(StoresVersion, Protocol[NativeSeriesT]):
19+
class CompliantSeries(HasVersion, Protocol[NativeSeriesT]):
2020
_native: NativeSeriesT
2121
_name: str
2222

narwhals/_plan/compliant/typing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ def namespace(obj: SupportsNarwhalsNamespace[NamespaceT_co], /) -> NamespaceT_co
8282
return obj.__narwhals_namespace__()
8383

8484

85-
# NOTE: Unlike the version in `nw._utils`, here `.version` it is public
86-
class StoresVersion(Protocol):
85+
# NOTE: Unlike `nw._utils._StoresVersion`, here the property is public
86+
class HasVersion(Protocol):
8787
_version: Version
8888

8989
@property

0 commit comments

Comments
 (0)