Skip to content

Fixup typing of Namespace #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 28 additions & 43 deletions spec/API_specification/dataframe_api/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,104 +65,89 @@
class Namespace(Protocol):
__dataframe_api_version__: str

@staticmethod
def Int64() -> Int64:
class Int64():
...

@staticmethod
def Int32() -> Int32:
class Int32():
...

@staticmethod
def Int16() -> Int16:
class Int16():
...

@staticmethod
def Int8() -> Int8:
class Int8():
...

@staticmethod
def UInt64() -> UInt64:
class UInt64():
...

@staticmethod
def UInt32() -> UInt32:
class UInt32():
...

@staticmethod
def UInt16() -> UInt16:
class UInt16():
...

@staticmethod
def UInt8() -> UInt8:
class UInt8():
...

@staticmethod
def Float64() -> Float64:
class Float64():
...

@staticmethod
def Float32() -> Float32:
class Float32():
...

@staticmethod
def Bool() -> Bool:
class Bool():
...

@staticmethod
def Date() -> Date:
class Date():
...

@staticmethod
def Datetime(time_unit: Literal['ms', 'us'], time_zone: str | None) -> Datetime:
...
class Datetime():
def __init__(
self,
time_unit: Literal['ms', 'us'],
time_zone: str | None,
):
...

@staticmethod
def String() -> String:
class String():
...

@staticmethod
def concat(dataframes: Sequence[DataFrame]) -> DataFrame:
def concat(self, dataframes: Sequence[DataFrame]) -> DataFrame:
...

@staticmethod
def column_from_sequence(
self,
sequence: Sequence[Any],
*,
dtype: Any,
name: str = "",
) -> Column:
...

@staticmethod
def dataframe_from_columns(*columns: Column) -> DataFrame:
def dataframe_from_columns(self, *columns: Column) -> DataFrame:
...

@staticmethod
def column_from_1d_array(
array: Any, *, dtype: Any, name: str = ""
self, array: Any, *, dtype: Any, name: str = ""
) -> Column:
...

@staticmethod
def dataframe_from_2d_array(
self,
array: Any,
*,
names: Sequence[str],
dtypes: Mapping[str, Any],
) -> DataFrame:
...

@staticmethod
def is_null(value: object, /) -> bool:
def is_null(self, value: object, /) -> bool:
...

@staticmethod
def is_dtype(dtype: Any, kind: str | tuple[str, ...]) -> bool:
def is_dtype(self, dtype: Any, kind: str | tuple[str, ...]) -> bool:
...

@staticmethod
def date(year: int, month: int, day: int) -> Scalar:
def date(self, year: int, month: int, day: int) -> Scalar:
...

class SupportsDataFrameAPI(Protocol):
Expand Down