1
1
from __future__ import annotations
2
2
3
- from typing import Any ,NoReturn , Sequence , TYPE_CHECKING , Literal , Generic
3
+ from typing import Any ,NoReturn , TYPE_CHECKING , Literal , Generic
4
4
5
5
from ._types import DType
6
6
7
7
if TYPE_CHECKING :
8
- from . import Bool , null
9
- from ._types import Scalar
8
+ from . import Bool
9
+ from ._types import NullType , Scalar
10
10
11
11
12
12
__all__ = ['Column' ]
@@ -455,7 +455,7 @@ def __invert__(self: Column[Bool]) -> Column[Bool]:
455
455
If any of the Column's columns is not boolean.
456
456
"""
457
457
458
- def any (self : Column [Bool ], * , skip_nulls : bool = True ) -> bool :
458
+ def any (self : Column [Bool ], * , skip_nulls : bool = True ) -> bool | NullType :
459
459
"""
460
460
Reduction returns a bool.
461
461
@@ -465,7 +465,7 @@ def any(self: Column[Bool], *, skip_nulls: bool = True) -> bool:
465
465
If column is not boolean.
466
466
"""
467
467
468
- def all (self : Column [Bool ], * , skip_nulls : bool = True ) -> bool :
468
+ def all (self : Column [Bool ], * , skip_nulls : bool = True ) -> bool | NullType :
469
469
"""
470
470
Reduction returns a bool.
471
471
@@ -475,48 +475,48 @@ def all(self: Column[Bool], *, skip_nulls: bool = True) -> bool:
475
475
If column is not boolean.
476
476
"""
477
477
478
- def min (self , * , skip_nulls : bool = True ) -> Scalar :
478
+ def min (self , * , skip_nulls : bool = True ) -> Scalar | NullType :
479
479
"""
480
480
Reduction returns a scalar. Any data type that supports comparisons
481
481
must be supported. The returned value has the same dtype as the column.
482
482
"""
483
483
484
- def max (self , * , skip_nulls : bool = True ) -> Scalar :
484
+ def max (self , * , skip_nulls : bool = True ) -> Scalar | NullType :
485
485
"""
486
486
Reduction returns a scalar. Any data type that supports comparisons
487
487
must be supported. The returned value has the same dtype as the column.
488
488
"""
489
489
490
- def sum (self , * , skip_nulls : bool = True ) -> Scalar :
490
+ def sum (self , * , skip_nulls : bool = True ) -> Scalar | NullType :
491
491
"""
492
492
Reduction returns a scalar. Must be supported for numerical and
493
493
datetime data types. The returned value has the same dtype as the
494
494
column.
495
495
"""
496
496
497
- def prod (self , * , skip_nulls : bool = True ) -> Scalar :
497
+ def prod (self , * , skip_nulls : bool = True ) -> Scalar | NullType :
498
498
"""
499
499
Reduction returns a scalar. Must be supported for numerical data types.
500
500
The returned value has the same dtype as the column.
501
501
"""
502
502
503
- def median (self , * , skip_nulls : bool = True ) -> Scalar :
503
+ def median (self , * , skip_nulls : bool = True ) -> Scalar | NullType :
504
504
"""
505
505
Reduction returns a scalar. Must be supported for numerical and
506
506
datetime data types. Returns a float for numerical data types, and
507
507
datetime (with the appropriate timedelta format string) for datetime
508
508
dtypes.
509
509
"""
510
510
511
- def mean (self , * , skip_nulls : bool = True ) -> Scalar :
511
+ def mean (self , * , skip_nulls : bool = True ) -> Scalar | NullType :
512
512
"""
513
513
Reduction returns a scalar. Must be supported for numerical and
514
514
datetime data types. Returns a float for numerical data types, and
515
515
datetime (with the appropriate timedelta format string) for datetime
516
516
dtypes.
517
517
"""
518
518
519
- def std (self , * , correction : int | float = 1 , skip_nulls : bool = True ) -> Scalar :
519
+ def std (self , * , correction : int | float = 1 , skip_nulls : bool = True ) -> Scalar | NullType :
520
520
"""
521
521
Reduction returns a scalar. Must be supported for numerical and
522
522
datetime data types. Returns a float for numerical data types, and
@@ -542,7 +542,7 @@ def std(self, *, correction: int | float = 1, skip_nulls: bool = True) -> Scalar
542
542
Whether to skip null values.
543
543
"""
544
544
545
- def var (self , * , correction : int | float = 1 , skip_nulls : bool = True ) -> Scalar :
545
+ def var (self , * , correction : int | float = 1 , skip_nulls : bool = True ) -> Scalar | NullType :
546
546
"""
547
547
Reduction returns a scalar. Must be supported for numerical and
548
548
datetime data types. Returns a float for numerical data types, and
@@ -662,7 +662,7 @@ def unique_indices(self, *, skip_nulls: bool = True) -> Column[Any]:
662
662
"""
663
663
...
664
664
665
- def fill_nan (self : Column [DType ], value : float | 'null' , / ) -> Column [DType ]:
665
+ def fill_nan (self : Column [DType ], value : float | NullType , / ) -> Column [DType ]:
666
666
"""
667
667
Fill floating point ``nan`` values with the given fill value.
668
668
0 commit comments