From f3a0332f649849b3753222d31d82b2faa45d75b6 Mon Sep 17 00:00:00 2001 From: Arwa Date: Mon, 11 Nov 2024 16:15:13 -0600 Subject: [PATCH] docs: update docstrings --- bigframes/core/indexes/base.py | 1 + .../pandas/core/indexes/base.py | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/bigframes/core/indexes/base.py b/bigframes/core/indexes/base.py index 0ba79bebee..210f95b593 100644 --- a/bigframes/core/indexes/base.py +++ b/bigframes/core/indexes/base.py @@ -154,6 +154,7 @@ def nlevels(self) -> int: def values(self) -> np.ndarray: return self.to_numpy() + ## need to be added to 3rd party is a separate PR @property def ndim(self) -> int: return 1 diff --git a/third_party/bigframes_vendored/pandas/core/indexes/base.py b/third_party/bigframes_vendored/pandas/core/indexes/base.py index 896dedb774..d197cc87c9 100644 --- a/third_party/bigframes_vendored/pandas/core/indexes/base.py +++ b/third_party/bigframes_vendored/pandas/core/indexes/base.py @@ -51,6 +51,9 @@ def values(self): **Examples:** + >>> import bigframes.pandas as bpd + >>> bpd.options.display.progress_bar = None + >>> idx = bpd.Index([1, 2, 3]) >>> idx Index([1, 2, 3], dtype='Int64') @@ -60,7 +63,7 @@ def values(self): Returns: array: - numpy.ndarray or ExtensionArray + Numpy.ndarray or ExtensionArray """ raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE) @@ -69,6 +72,23 @@ def values(self): def shape(self): """ Return a tuple of the shape of the underlying data. + + **Examples:** + + >>> import bigframes.pandas as bpd + >>> bpd.options.display.progress_bar = None + + >>> idx = pd.Index([1, 2, 3]) + >>> idx + Index([1, 2, 3], dtype='Int64') + + >>> idx.shape + (3,) + + Returns: + Tuple[int]: + A tuple of int representing the shape. + """ raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)