Skip to content

Commit 9ebd79d

Browse files
committed
wip try fixing build
1 parent 09e6684 commit 9ebd79d

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

spec/API_specification/dataframe_api/__init__.py

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
from .eagercolumn_object import EagerColumn
99
from .expression_object import Expression
1010
from .dataframe_object import DataFrame
11-
from .groupby_object import GroupBy
12-
from ._types import DType
1311

1412
__all__ = [
1513
"__dataframe_api_version__",

spec/API_specification/dataframe_api/dataframe_object.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@
66
if TYPE_CHECKING:
77
from .expression_object import Expression
88
from .eagerframe_object import EagerFrame
9+
from .eagercolumn_object import EagerColumn
910
from .groupby_object import GroupBy
1011
from ._types import NullType, Scalar
1112

1213

1314
__all__ = ["DataFrame"]
1415

16+
IntoExpression = EagerColumn[Any] | Expression
17+
1518

1619
class DataFrame:
1720
"""
@@ -167,7 +170,7 @@ def filter(self, mask: Expression) -> DataFrame:
167170
"""
168171
...
169172

170-
def insert_column(self, column: Expression) -> DataFrame:
173+
def insert_columns(self, columns: IntoExpression | Sequence[IntoExpression]) -> DataFrame:
171174
"""
172175
Insert column into DataFrame at rightmost location.
173176
@@ -198,11 +201,12 @@ def insert_column(self, column: Expression) -> DataFrame:
198201
199202
Parameters
200203
----------
201-
expression : Expression
204+
columns
205+
A single column, an expression, or a sequence of either.
202206
"""
203207
...
204208

205-
def update_columns(self, columns: Expression | Sequence[Expression], /) -> DataFrame:
209+
def update_columns(self, columns: Expression | EagerColumn | Sequence[Expression | EagerColumn], /) -> DataFrame:
206210
"""
207211
Update values in existing column(s) from Dataframe.
208212

spec/API_specification/dataframe_api/eagerframe_object.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class EagerFrame:
2323
2424
Convert back to `:class:`DataFrame` using `:meth:`EagerFrame.relax()`.
2525
"""
26-
def __eagerframe_namespace__(self) -> Any:
26+
def __dataframe_namespace__(self) -> Any:
2727
"""
2828
Returns an object that has all the top-level dataframe API functions on it.
2929
@@ -90,7 +90,7 @@ def get_column_by_name(self, name: str, /) -> EagerColumn[Any]:
9090
"""
9191
...
9292

93-
def select(self, names: Sequence[str | Expression], /) -> EagerFrame:
93+
def select(self, names: str | Expression | Sequence[str | Expression], /) -> EagerFrame:
9494
"""
9595
Select multiple columns by name.
9696
@@ -158,7 +158,7 @@ def filter(self, mask: Expression) -> EagerFrame:
158158
"""
159159
...
160160

161-
def insert_column(self, column: Expression) -> EagerFrame:
161+
def insert_columns(self, columns: Expression | EagerColumn | Sequence[Expression | EagerColumn]) -> EagerFrame:
162162
"""
163163
Insert column into DataFrame at rightmost location.
164164
@@ -169,7 +169,7 @@ def insert_column(self, column: Expression) -> EagerFrame:
169169
.. code-block:: python
170170
171171
new_column = df.get_column_by_name('a') + 1
172-
df = df.insert_column(new_column.rename('a_plus_1').to_expression())
172+
df = df.insert_column(new_column.rename('a_plus_1'))
173173
174174
If you need to insert the column at a different location, combine with
175175
:meth:`get_columns_by_name`, e.g.:
@@ -178,12 +178,13 @@ def insert_column(self, column: Expression) -> EagerFrame:
178178
179179
new_column = df.get_column_by_name('a') + 1
180180
new_columns_names = ['a_plus_1'] + df.get_column_names()
181-
df = df.insert_column(new_column.rename('a_plus_1').to_expression())
181+
df = df.insert_column(new_column.rename('a_plus_1'))
182182
df = df.select(new_column_names)
183183
184184
Parameters
185185
----------
186-
column : Expression
186+
columns
187+
A single column, an expression, or a sequence of either.
187188
"""
188189
...
189190

spec/conf.py

+3
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
nitpick_ignore = [
7575
('py:class', 'array'),
7676
('py:class', 'DataFrame'),
77+
('py:class', 'EagerFrame'),
78+
('py:class', 'EagerColumn'),
79+
('py:class', 'Expression'),
7780
('py:class', 'device'),
7881
('py:class', 'DType'),
7982
('py:class', 'NestedSequence'),

0 commit comments

Comments
 (0)