Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Fix 2-argument math functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Johannes Huber authored and zero323 committed Aug 24, 2019
1 parent 1725c54 commit fcf3a25
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion third_party/3/pyspark/sql/_typing.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Any, List, Optional, TypeVar, Union
from typing import Any, List, Optional, TypeVar, Union, SupportsFloat
from typing_extensions import Protocol
import datetime
import decimal
Expand All @@ -7,6 +7,7 @@ import pyspark.sql.column
import pyspark.sql.types

ColumnOrName = Union[pyspark.sql.column.Column, str]
ColumnNameOrFloat = Union[ColumnOrName, SupportsFloat]
DecimalLiteral = decimal.Decimal
DateTimeLiteral = Union[datetime.datetime, datetime.date]
LiteralType = Union[bool, int, float, str]
Expand Down
21 changes: 18 additions & 3 deletions third_party/3/pyspark/sql/functions.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Stubs for pyspark.sql.functions (Python 3.5)

from typing import overload
from typing import Any, Optional, Union, Dict, Callable
from typing import Any, Optional, Union, Dict, Callable, SupportsFloat

import pandas.core.frame # type: ignore
import pandas.core.series # type: ignore
Expand Down Expand Up @@ -164,7 +164,12 @@ def asc_nulls_last(col: ColumnOrName) -> Column: ...
def ascii(col: ColumnOrName) -> Column: ...
def asin(col: ColumnOrName) -> Column: ...
def atan(col: ColumnOrName) -> Column: ...
def atan2(col: ColumnOrName) -> Column: ...
@overload
def atan2(col1: ColumnOrName, col2: ColumnOrName) -> Column: ...
@overload
def atan2(col1: SupportsFloat, col2: ColumnOrName) -> Column: ...
@overload
def atan2(col1: ColumnOrName, col2: SupportsFloat) -> Column: ...
def avg(col: ColumnOrName) -> Column: ...
def base64(col: ColumnOrName) -> Column: ...
def bitwiseNOT(col: ColumnOrName) -> Column: ...
Expand All @@ -186,7 +191,12 @@ def desc_nulls_last(col: ColumnOrName) -> Column: ...
def exp(col: ColumnOrName) -> Column: ...
def expm1(col: ColumnOrName) -> Column: ...
def floor(col: ColumnOrName) -> Column: ...
def hypot(col: ColumnOrName) -> Column: ...
@overload
def hypot(col1: ColumnOrName, col2: ColumnOrName) -> Column: ...
@overload
def hypot(col1: SupportsFloat, col2: ColumnOrName) -> Column: ...
@overload
def hypot(col1: ColumnOrName, col2: SupportsFloat) -> Column: ...
def kurtosis(col: ColumnOrName) -> Column: ...
def lit(col: Any) -> Column: ...
def log10(col: ColumnOrName) -> Column: ...
Expand All @@ -197,7 +207,12 @@ def max(col: ColumnOrName) -> Column: ...
def mean(col: ColumnOrName) -> Column: ...
def min(col: ColumnOrName) -> Column: ...
def percent_rank() -> Column: ...
@overload
def pow(col1: ColumnOrName, col2: ColumnOrName) -> Column: ...
@overload
def pow(col1: SupportsFloat, col2: ColumnOrName) -> Column: ...
@overload
def pow(col1: ColumnOrName, col2: SupportsFloat) -> Column: ...
def radians(col: ColumnOrName) -> Column: ...
def rank() -> Column: ...
def rint(col: ColumnOrName) -> Column: ...
Expand Down

0 comments on commit fcf3a25

Please sign in to comment.