Skip to content
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

docs: update bigframes.pandas.pandas docstrings #1247

Merged
merged 6 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 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: 2 additions & 1 deletion bigframes/pandas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ def get_default_session_id() -> str:
the table id of all temporary tables created in the global session.

Returns:
str, the default global session id, ex. 'sessiona1b2c'
str:
The default global session id, ex. 'sessiona1b2c'
"""
return get_global_session().session_id

Expand Down
14 changes: 8 additions & 6 deletions bigframes/session/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,8 @@ def read_gbq_model(self, model_name: str):
to load from the default project.

Returns:
A bigframes.ml Model, Transformer or Pipeline wrapping the model.
bigframes.ml model:
arwas11 marked this conversation as resolved.
Show resolved Hide resolved
A bigframes.ml Model, Transformer or Pipeline wrapping the model.
"""
import bigframes.ml.loader

Expand Down Expand Up @@ -1545,12 +1546,13 @@ def read_gbq_function(
a pandas Series.

Returns:
callable: A function object pointing to the BigQuery function read
from BigQuery.
callable:
arwas11 marked this conversation as resolved.
Show resolved Hide resolved
A function object pointing to the BigQuery function read
from BigQuery.

The object is similar to the one created by the `remote_function`
decorator, including the `bigframes_remote_function` property, but
not including the `bigframes_cloud_function` property.
The object is similar to the one created by the `remote_function`
decorator, including the `bigframes_remote_function` property, but
not including the `bigframes_cloud_function` property.
"""

return bigframes_rf.read_gbq_function(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ def get_dummies(
Data type for new columns. Only a single dtype is allowed.

Returns:
DataFrame: Dummy-coded data. If data contains other columns than the
dummy-coded one(s), these will be prepended, unaltered, to the
result.
bigframes.pandas.DataFrame:
Dummy-coded data. If data contains other columns than the
dummy-coded one(s), these will be prepended, unaltered, to the
result.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def merge(
no suffix. At least one of the values must not be None.

Returns:
bigframes.dataframe.DataFrame: A DataFrame of the two merged objects.
bigframes.pandas.DataFrame:
A DataFrame of the two merged objects.
"""
raise NotImplementedError("abstract method")
7 changes: 5 additions & 2 deletions third_party/bigframes_vendored/pandas/core/reshape/tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def cut(

>>> import bigframes.pandas as bpd
>>> bpd.options.display.progress_bar = None

>>> s = bpd.Series([0, 1, 5, 10])
>>> s
0 0
Expand Down Expand Up @@ -108,7 +109,8 @@ def cut(
bins. This affects the type of the output container.

Returns:
Series: A Series representing the respective bin for each value
bigframes.pandas.Series:
A Series representing the respective bin for each value
of `x`. The type depends on the value of `labels`.
sequence of scalars : returns a Series for Series `x` or a
Categorical for all other inputs. The values stored within
Expand Down Expand Up @@ -140,7 +142,8 @@ def qcut(x, q, *, labels=None, duplicates="error"):
If bin edges are not unique, raise ValueError or drop non-uniques.

Returns:
Series: Categorical or Series of integers if labels is False
bigframes.pandas.Series:
Categorical or Series of integers if labels is False
The return type (Categorical or Series) depends on the input: a Series
of type category if input is a Series else Categorical. Bins are
represented as categories when categorical data is returned.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def to_datetime(
float number.

Returns:
Timestamp, datetime.datetime or bigframes.series.Series: Return type depends on input.
Union[pandas.Timestamp, datetime.datetime or bigframes.pandas.Series]:
Return type depends on input.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
3 changes: 2 additions & 1 deletion third_party/bigframes_vendored/pandas/io/gbq.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def read_gbq(
from a table.

Returns:
bigframes.pandas.DataFrame: A DataFrame representing results of the query or table.
bigframes.pandas.DataFrame:
A DataFrame representing results of the query or table.
"""
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ def read_csv(
keyword arguments for `pandas.read_csv` when not using the BigQuery engine.

Returns:
bigframes.pandas.DataFrame: A BigQuery DataFrames.
bigframes.pandas.DataFrame:
A BigQuery DataFrames.

Raises:
bigframes.exceptions.DefaultIndexWarning:
Expand Down
Loading