Skip to content

type DataFrame, Column, and GroupBy as Protocol #291

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
Show file tree
Hide file tree
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
3 changes: 0 additions & 3 deletions spec/API_specification/.mypy.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[mypy]
strict=True

[mypy-dataframe_api.*]
disable_error_code=empty-body
1 change: 1 addition & 0 deletions spec/API_specification/dataframe_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# mypy: disable-error-code="empty-body"
"""
Function stubs and API documentation for the DataFrame API standard.
"""
Expand Down
4 changes: 2 additions & 2 deletions spec/API_specification/dataframe_api/column_object.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Any,NoReturn, TYPE_CHECKING, Literal, Generic
from typing import Any,NoReturn, TYPE_CHECKING, Literal, Protocol

if TYPE_CHECKING:
from .typing import NullType, Scalar, DType, Namespace
Expand All @@ -9,7 +9,7 @@
__all__ = ['Column']


class Column:
class Column(Protocol):
"""
Column object

Expand Down
4 changes: 2 additions & 2 deletions spec/API_specification/dataframe_api/dataframe_object.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Any, Literal, Mapping, Sequence, Union, TYPE_CHECKING, NoReturn
from typing import Any, Literal, Mapping, Sequence, TYPE_CHECKING, NoReturn, Protocol


if TYPE_CHECKING:
Expand All @@ -12,7 +12,7 @@
__all__ = ["DataFrame"]


class DataFrame:
class DataFrame(Protocol):
"""
DataFrame object

Expand Down
4 changes: 2 additions & 2 deletions spec/API_specification/dataframe_api/groupby_object.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING
from typing import TYPE_CHECKING, Protocol

if TYPE_CHECKING:
from .dataframe_object import DataFrame
Expand All @@ -9,7 +9,7 @@
__all__ = ['GroupBy']


class GroupBy:
class GroupBy(Protocol):
"""
GroupBy object.

Expand Down