1
1
from __future__ import annotations
2
2
3
- from typing import NoReturn , Sequence
3
+ from typing import NoReturn , Sequence , TYPE_CHECKING
4
4
5
- from ._types import Scalar , dtype
5
+ if TYPE_CHECKING :
6
+ from ._types import Scalar , DType
6
7
7
8
8
9
__all__ = ['Column' ]
@@ -34,6 +35,12 @@ def __iter__(self) -> NoReturn:
34
35
"""
35
36
raise NotImplementedError ("'__iter__' is intentionally not implemented." )
36
37
38
+ @property
39
+ def dtype (self ) -> DType :
40
+ """
41
+ Return data type of column.
42
+ """
43
+
37
44
def get_rows (self , indices : Column [int ]) -> Column :
38
45
"""
39
46
Select a subset of rows, similar to `ndarray.take`.
@@ -45,7 +52,7 @@ def get_rows(self, indices: Column[int]) -> Column:
45
52
"""
46
53
...
47
54
48
- def get_value (self , row_number : int ) -> dtype :
55
+ def get_value (self , row_number : int ) -> DType :
49
56
"""
50
57
Select the value at a row number, similar to `ndarray.__getitem__(<int>)`.
51
58
@@ -316,56 +323,56 @@ def all(self, *, skip_nulls: bool = True) -> bool:
316
323
If column is not boolean.
317
324
"""
318
325
319
- def min (self , * , skip_nulls : bool = True ) -> dtype :
326
+ def min (self , * , skip_nulls : bool = True ) -> DType :
320
327
"""
321
328
Reduction returns a scalar. Any data type that supports comparisons
322
329
must be supported. The returned value has the same dtype as the column.
323
330
"""
324
331
325
- def max (self , * , skip_nulls : bool = True ) -> dtype :
332
+ def max (self , * , skip_nulls : bool = True ) -> DType :
326
333
"""
327
334
Reduction returns a scalar. Any data type that supports comparisons
328
335
must be supported. The returned value has the same dtype as the column.
329
336
"""
330
337
331
- def sum (self , * , skip_nulls : bool = True ) -> dtype :
338
+ def sum (self , * , skip_nulls : bool = True ) -> DType :
332
339
"""
333
340
Reduction returns a scalar. Must be supported for numerical and
334
341
datetime data types. The returned value has the same dtype as the
335
342
column.
336
343
"""
337
344
338
- def prod (self , * , skip_nulls : bool = True ) -> dtype :
345
+ def prod (self , * , skip_nulls : bool = True ) -> DType :
339
346
"""
340
347
Reduction returns a scalar. Must be supported for numerical data types.
341
348
The returned value has the same dtype as the column.
342
349
"""
343
350
344
- def median (self , * , skip_nulls : bool = True ) -> dtype :
351
+ def median (self , * , skip_nulls : bool = True ) -> DType :
345
352
"""
346
353
Reduction returns a scalar. Must be supported for numerical and
347
354
datetime data types. Returns a float for numerical data types, and
348
355
datetime (with the appropriate timedelta format string) for datetime
349
356
dtypes.
350
357
"""
351
358
352
- def mean (self , * , skip_nulls : bool = True ) -> dtype :
359
+ def mean (self , * , skip_nulls : bool = True ) -> DType :
353
360
"""
354
361
Reduction returns a scalar. Must be supported for numerical and
355
362
datetime data types. Returns a float for numerical data types, and
356
363
datetime (with the appropriate timedelta format string) for datetime
357
364
dtypes.
358
365
"""
359
366
360
- def std (self , * , skip_nulls : bool = True ) -> dtype :
367
+ def std (self , * , skip_nulls : bool = True ) -> DType :
361
368
"""
362
369
Reduction returns a scalar. Must be supported for numerical and
363
370
datetime data types. Returns a float for numerical data types, and
364
371
datetime (with the appropriate timedelta format string) for datetime
365
372
dtypes.
366
373
"""
367
374
368
- def var (self , * , skip_nulls : bool = True ) -> dtype :
375
+ def var (self , * , skip_nulls : bool = True ) -> DType :
369
376
"""
370
377
Reduction returns a scalar. Must be supported for numerical and
371
378
datetime data types. Returns a float for numerical data types, and
0 commit comments