11from __future__ import annotations
22
3- from typing import NoReturn , Sequence
3+ from typing import NoReturn , Sequence , TYPE_CHECKING
44
5- from ._types import Scalar , dtype
5+ if TYPE_CHECKING :
6+ from ._types import Scalar , DType
67
78
89__all__ = ['Column' ]
@@ -34,6 +35,12 @@ def __iter__(self) -> NoReturn:
3435 """
3536 raise NotImplementedError ("'__iter__' is intentionally not implemented." )
3637
38+ @property
39+ def dtype (self ) -> DType :
40+ """
41+ Return data type of column.
42+ """
43+
3744 def get_rows (self , indices : Column [int ]) -> Column :
3845 """
3946 Select a subset of rows, similar to `ndarray.take`.
@@ -45,7 +52,7 @@ def get_rows(self, indices: Column[int]) -> Column:
4552 """
4653 ...
4754
48- def get_value (self , row_number : int ) -> dtype :
55+ def get_value (self , row_number : int ) -> DType :
4956 """
5057 Select the value at a row number, similar to `ndarray.__getitem__(<int>)`.
5158
@@ -316,56 +323,56 @@ def all(self, *, skip_nulls: bool = True) -> bool:
316323 If column is not boolean.
317324 """
318325
319- def min (self , * , skip_nulls : bool = True ) -> dtype :
326+ def min (self , * , skip_nulls : bool = True ) -> DType :
320327 """
321328 Reduction returns a scalar. Any data type that supports comparisons
322329 must be supported. The returned value has the same dtype as the column.
323330 """
324331
325- def max (self , * , skip_nulls : bool = True ) -> dtype :
332+ def max (self , * , skip_nulls : bool = True ) -> DType :
326333 """
327334 Reduction returns a scalar. Any data type that supports comparisons
328335 must be supported. The returned value has the same dtype as the column.
329336 """
330337
331- def sum (self , * , skip_nulls : bool = True ) -> dtype :
338+ def sum (self , * , skip_nulls : bool = True ) -> DType :
332339 """
333340 Reduction returns a scalar. Must be supported for numerical and
334341 datetime data types. The returned value has the same dtype as the
335342 column.
336343 """
337344
338- def prod (self , * , skip_nulls : bool = True ) -> dtype :
345+ def prod (self , * , skip_nulls : bool = True ) -> DType :
339346 """
340347 Reduction returns a scalar. Must be supported for numerical data types.
341348 The returned value has the same dtype as the column.
342349 """
343350
344- def median (self , * , skip_nulls : bool = True ) -> dtype :
351+ def median (self , * , skip_nulls : bool = True ) -> DType :
345352 """
346353 Reduction returns a scalar. Must be supported for numerical and
347354 datetime data types. Returns a float for numerical data types, and
348355 datetime (with the appropriate timedelta format string) for datetime
349356 dtypes.
350357 """
351358
352- def mean (self , * , skip_nulls : bool = True ) -> dtype :
359+ def mean (self , * , skip_nulls : bool = True ) -> DType :
353360 """
354361 Reduction returns a scalar. Must be supported for numerical and
355362 datetime data types. Returns a float for numerical data types, and
356363 datetime (with the appropriate timedelta format string) for datetime
357364 dtypes.
358365 """
359366
360- def std (self , * , skip_nulls : bool = True ) -> dtype :
367+ def std (self , * , skip_nulls : bool = True ) -> DType :
361368 """
362369 Reduction returns a scalar. Must be supported for numerical and
363370 datetime data types. Returns a float for numerical data types, and
364371 datetime (with the appropriate timedelta format string) for datetime
365372 dtypes.
366373 """
367374
368- def var (self , * , skip_nulls : bool = True ) -> dtype :
375+ def var (self , * , skip_nulls : bool = True ) -> DType :
369376 """
370377 Reduction returns a scalar. Must be supported for numerical and
371378 datetime data types. Returns a float for numerical data types, and
0 commit comments