Skip to content

Commit 68e08c0

Browse files
committed
rename dtype typevar
1 parent d10e22a commit 68e08c0

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

spec/API_specification/dataframe_api/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .column_object import *
99
from .dataframe_object import DataFrame
1010
from .groupby_object import *
11-
from ._types import DType
11+
from ._types import DTypeT
1212

1313
__all__ = [
1414
"__dataframe_api_version__",

spec/API_specification/dataframe_api/_types.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
array = TypeVar("array")
2828
device = TypeVar("device")
29-
DType = TypeVar("DType")
29+
DTypeT = TypeVar("DTypeT")
3030
SupportsDLPack = TypeVar("SupportsDLPack")
3131
SupportsBufferProtocol = TypeVar("SupportsBufferProtocol")
3232
PyCapsule = TypeVar("PyCapsule")
@@ -60,7 +60,7 @@ def __len__(self, /) -> int:
6060
"Sequence",
6161
"array",
6262
"device",
63-
"DType",
63+
"DTypeT",
6464
"ellipsis",
6565
"Enum",
6666
]

spec/API_specification/dataframe_api/column_object.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from typing import Any,NoReturn, Sequence, TYPE_CHECKING, Literal, Generic
44

5-
from ._types import DType
5+
from ._types import DTypeT
66

77
if TYPE_CHECKING:
88
from . import Bool, null
@@ -12,7 +12,7 @@
1212
__all__ = ['Column']
1313

1414

15-
class Column(Generic[DType]):
15+
class Column(Generic[DTypeT]):
1616
"""
1717
Column object
1818
@@ -81,7 +81,7 @@ def dtype(self) -> Any:
8181
Return data type of column.
8282
"""
8383

84-
def get_rows(self: Column[DType], indices: Column[Any]) -> Column[DType]:
84+
def get_rows(self: Column[DTypeT], indices: Column[Any]) -> Column[DTypeT]:
8585
"""
8686
Select a subset of rows, similar to `ndarray.take`.
8787
@@ -157,7 +157,7 @@ def __eq__(self, other: Column[Any] | Scalar) -> Column[Bool]: # type: ignore[o
157157
Column
158158
"""
159159

160-
def __ne__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]: # type: ignore[override]
160+
def __ne__(self: Column[DTypeT], other: Column[DTypeT] | Scalar) -> Column[Bool]: # type: ignore[override]
161161
"""
162162
Compare for non-equality.
163163
@@ -175,7 +175,7 @@ def __ne__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
175175
Column
176176
"""
177177

178-
def __ge__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
178+
def __ge__(self: Column[DTypeT], other: Column[DTypeT] | Scalar) -> Column[Bool]:
179179
"""
180180
Compare for "greater than or equal to" `other`.
181181
@@ -191,7 +191,7 @@ def __ge__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
191191
Column
192192
"""
193193

194-
def __gt__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
194+
def __gt__(self: Column[DTypeT], other: Column[DTypeT] | Scalar) -> Column[Bool]:
195195
"""
196196
Compare for "greater than" `other`.
197197
@@ -207,7 +207,7 @@ def __gt__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
207207
Column
208208
"""
209209

210-
def __le__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
210+
def __le__(self: Column[DTypeT], other: Column[DTypeT] | Scalar) -> Column[Bool]:
211211
"""
212212
Compare for "less than or equal to" `other`.
213213
@@ -223,7 +223,7 @@ def __le__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
223223
Column
224224
"""
225225

226-
def __lt__(self: Column[DType], other: Column[DType] | Scalar) -> Column[Bool]:
226+
def __lt__(self: Column[DTypeT], other: Column[DTypeT] | Scalar) -> Column[Bool]:
227227
"""
228228
Compare for "less than" `other`.
229229
@@ -527,26 +527,26 @@ def var(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar
527527
Whether to skip null values.
528528
"""
529529

530-
def cumulative_max(self: Column[DType]) -> Column[DType]:
530+
def cumulative_max(self: Column[DTypeT]) -> Column[DTypeT]:
531531
"""
532532
Reduction returns a Column. Any data type that supports comparisons
533533
must be supported. The returned value has the same dtype as the column.
534534
"""
535535

536-
def cumulative_min(self: Column[DType]) -> Column[DType]:
536+
def cumulative_min(self: Column[DTypeT]) -> Column[DTypeT]:
537537
"""
538538
Reduction returns a Column. Any data type that supports comparisons
539539
must be supported. The returned value has the same dtype as the column.
540540
"""
541541

542-
def cumulative_sum(self: Column[DType]) -> Column[DType]:
542+
def cumulative_sum(self: Column[DTypeT]) -> Column[DTypeT]:
543543
"""
544544
Reduction returns a Column. Must be supported for numerical and
545545
datetime data types. The returned value has the same dtype as the
546546
column.
547547
"""
548548

549-
def cumulative_prod(self: Column[DType]) -> Column[DType]:
549+
def cumulative_prod(self: Column[DTypeT]) -> Column[DTypeT]:
550550
"""
551551
Reduction returns a Column. Must be supported for numerical and
552552
datetime data types. The returned value has the same dtype as the
@@ -591,7 +591,7 @@ def is_nan(self) -> Column[Bool]:
591591
In particular, does not check for `np.timedelta64('NaT')`.
592592
"""
593593

594-
def is_in(self: Column[DType], values: Column[DType]) -> Column[Bool]:
594+
def is_in(self: Column[DTypeT], values: Column[DTypeT]) -> Column[Bool]:
595595
"""
596596
Indicate whether the value at each row matches any value in `values`.
597597
@@ -630,7 +630,7 @@ def unique_indices(self, *, skip_nulls: bool = True) -> Column[Any]:
630630
"""
631631
...
632632

633-
def fill_nan(self: Column[DType], value: float | 'null', /) -> Column[DType]:
633+
def fill_nan(self: Column[DTypeT], value: float | 'null', /) -> Column[DTypeT]:
634634
"""
635635
Fill floating point ``nan`` values with the given fill value.
636636
@@ -644,7 +644,7 @@ def fill_nan(self: Column[DType], value: float | 'null', /) -> Column[DType]:
644644
"""
645645
...
646646

647-
def fill_null(self: Column[DType], value: Scalar, /) -> Column[DType]:
647+
def fill_null(self: Column[DTypeT], value: Scalar, /) -> Column[DTypeT]:
648648
"""
649649
Fill null values with the given fill value.
650650

0 commit comments

Comments
 (0)