Skip to content

Commit 12e8cd7

Browse files
fill previously inherited members
1 parent d2165d4 commit 12e8cd7

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

bigframes/dataframe.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
overload,
3838
Sequence,
3939
Tuple,
40+
TypeVar,
4041
Union,
4142
)
4243
import warnings
@@ -108,6 +109,7 @@
108109
"DataFrame", Sequence[int | float | str | pandas.Timedelta | Callable]
109110
]
110111

112+
U = TypeVar("U")
111113
LevelType = typing.Hashable
112114
LevelsType = typing.Union[LevelType, typing.Sequence[LevelType]]
113115

@@ -3760,6 +3762,22 @@ def expanding(self, min_periods: int = 1) -> bigframes.core.window.Window:
37603762
self._block, window, self._block.value_columns
37613763
)
37623764

3765+
def pipe(
3766+
self,
3767+
func: Union[Callable[..., U], tuple[Callable[..., U], str]],
3768+
*args,
3769+
**kwargs,
3770+
) -> U:
3771+
import bigframes_vendored.pandas.core.common as common
3772+
3773+
return common.pipe(self, func, *args, **kwargs)
3774+
3775+
def get(self, key, default=None):
3776+
try:
3777+
return self[key]
3778+
except (KeyError, ValueError, IndexError):
3779+
return default
3780+
37633781
def groupby(
37643782
self,
37653783
by: typing.Union[

bigframes/series.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
overload,
3535
Sequence,
3636
Tuple,
37+
TypeVar,
3738
Union,
3839
)
3940
import warnings
@@ -84,6 +85,7 @@
8485
import bigframes.operations.strings as strings
8586

8687

88+
U = TypeVar("U")
8789
LevelType = typing.Union[str, int]
8890
LevelsType = typing.Union[LevelType, typing.Sequence[LevelType]]
8991

@@ -1886,6 +1888,22 @@ def expanding(self, min_periods: int = 1) -> bigframes.core.window.Window:
18861888
self._block, window_spec, self._block.value_columns, is_series=True
18871889
)
18881890

1891+
def pipe(
1892+
self,
1893+
func: Union[Callable[..., U], tuple[Callable[..., U], str]],
1894+
*args,
1895+
**kwargs,
1896+
) -> U:
1897+
import bigframes_vendored.pandas.core.common as common
1898+
1899+
return common.pipe(self, func, *args, **kwargs)
1900+
1901+
def get(self, key, default=None):
1902+
try:
1903+
return self[key]
1904+
except (KeyError, ValueError, IndexError):
1905+
return default
1906+
18891907
def groupby(
18901908
self,
18911909
by: typing.Union[

third_party/bigframes_vendored/pandas/core/generic.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
import bigframes_vendored.constants as constants
77
from bigframes_vendored.pandas.core import indexing
8-
import bigframes_vendored.pandas.core.common as common
98

109
if TYPE_CHECKING:
1110
from bigframes_vendored.pandas.pandas._typing import T
@@ -395,10 +394,7 @@ def get(self, key, default=None):
395394
Any:
396395
same type as items contained in object
397396
"""
398-
try:
399-
return self[key]
400-
except (KeyError, ValueError, IndexError):
401-
return default
397+
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
402398

403399
def add_prefix(self, prefix: str, axis: int | str | None = None):
404400
"""Prefix labels with string `prefix`.
@@ -1227,7 +1223,7 @@ def pipe(
12271223
bigframes.pandas.DataFrame or bigframes.pandas.Series:
12281224
Object of same type as caller
12291225
"""
1230-
return common.pipe(self, func, *args, **kwargs)
1226+
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
12311227

12321228
def __getattr__(self, name: str):
12331229
"""

0 commit comments

Comments
 (0)