Skip to content

Commit c4bffc3

Browse files
authored
docs: update bigframes.pandas.pandas docstrings (#1247)
* docs: update bigframes.pandas.pandas docstrings * update read_qbq_model return type * update read_qbq_model return section and callable return type
1 parent b863358 commit c4bffc3

File tree

8 files changed

+31
-20
lines changed

8 files changed

+31
-20
lines changed

bigframes/pandas/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ def get_default_session_id() -> str:
163163
the table id of all temporary tables created in the global session.
164164
165165
Returns:
166-
str, the default global session id, ex. 'sessiona1b2c'
166+
str:
167+
The default global session id, ex. 'sessiona1b2c'
167168
"""
168169
return get_global_session().session_id
169170

bigframes/session/__init__.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,13 +1370,14 @@ def remote_function(
13701370
`all`, `internal-only`, `internal-and-gclb`. See for more details
13711371
https://cloud.google.com/functions/docs/networking/network-settings#ingress_settings.
13721372
Returns:
1373-
callable: A remote function object pointing to the cloud assets created
1374-
in the background to support the remote execution. The cloud assets can be
1375-
located through the following properties set in the object:
1373+
collections.abc.Callable:
1374+
A remote function object pointing to the cloud assets created
1375+
in the background to support the remote execution. The cloud assets can be
1376+
located through the following properties set in the object:
13761377
1377-
`bigframes_cloud_function` - The google cloud function deployed for the user defined code.
1378+
`bigframes_cloud_function` - The google cloud function deployed for the user defined code.
13781379
1379-
`bigframes_remote_function` - The bigquery remote function capable of calling into `bigframes_cloud_function`.
1380+
`bigframes_remote_function` - The bigquery remote function capable of calling into `bigframes_cloud_function`.
13801381
"""
13811382
return self._remote_function_session.remote_function(
13821383
input_types,
@@ -1545,12 +1546,13 @@ def read_gbq_function(
15451546
a pandas Series.
15461547
15471548
Returns:
1548-
callable: A function object pointing to the BigQuery function read
1549-
from BigQuery.
1549+
collections.abc.Callable:
1550+
A function object pointing to the BigQuery function read
1551+
from BigQuery.
15501552
1551-
The object is similar to the one created by the `remote_function`
1552-
decorator, including the `bigframes_remote_function` property, but
1553-
not including the `bigframes_cloud_function` property.
1553+
The object is similar to the one created by the `remote_function`
1554+
decorator, including the `bigframes_remote_function` property, but
1555+
not including the `bigframes_cloud_function` property.
15541556
"""
15551557

15561558
return bigframes_rf.read_gbq_function(

third_party/bigframes_vendored/pandas/core/reshape/encoding.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ def get_dummies(
113113
Data type for new columns. Only a single dtype is allowed.
114114
115115
Returns:
116-
DataFrame: Dummy-coded data. If data contains other columns than the
117-
dummy-coded one(s), these will be prepended, unaltered, to the
118-
result.
116+
bigframes.pandas.DataFrame:
117+
Dummy-coded data. If data contains other columns than the
118+
dummy-coded one(s), these will be prepended, unaltered, to the
119+
result.
119120
"""
120121
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/pandas/core/reshape/merge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def merge(
7474
no suffix. At least one of the values must not be None.
7575
7676
Returns:
77-
bigframes.dataframe.DataFrame: A DataFrame of the two merged objects.
77+
bigframes.pandas.DataFrame:
78+
A DataFrame of the two merged objects.
7879
"""
7980
raise NotImplementedError("abstract method")

third_party/bigframes_vendored/pandas/core/reshape/tile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def cut(
2828
2929
>>> import bigframes.pandas as bpd
3030
>>> bpd.options.display.progress_bar = None
31+
3132
>>> s = bpd.Series([0, 1, 5, 10])
3233
>>> s
3334
0 0
@@ -108,7 +109,8 @@ def cut(
108109
bins. This affects the type of the output container.
109110
110111
Returns:
111-
Series: A Series representing the respective bin for each value
112+
bigframes.pandas.Series:
113+
A Series representing the respective bin for each value
112114
of `x`. The type depends on the value of `labels`.
113115
sequence of scalars : returns a Series for Series `x` or a
114116
Categorical for all other inputs. The values stored within
@@ -140,7 +142,8 @@ def qcut(x, q, *, labels=None, duplicates="error"):
140142
If bin edges are not unique, raise ValueError or drop non-uniques.
141143
142144
Returns:
143-
Series: Categorical or Series of integers if labels is False
145+
bigframes.pandas.Series:
146+
Categorical or Series of integers if labels is False
144147
The return type (Categorical or Series) depends on the input: a Series
145148
of type category if input is a Series else Categorical. Bins are
146149
represented as categories when categorical data is returned.

third_party/bigframes_vendored/pandas/core/tools/datetimes.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def to_datetime(
7171
float number.
7272
7373
Returns:
74-
Timestamp, datetime.datetime or bigframes.series.Series: Return type depends on input.
74+
Union[pandas.Timestamp, datetime.datetime or bigframes.pandas.Series]:
75+
Return type depends on input.
7576
"""
7677
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/pandas/io/gbq.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def read_gbq(
167167
from a table.
168168
169169
Returns:
170-
bigframes.pandas.DataFrame: A DataFrame representing results of the query or table.
170+
bigframes.pandas.DataFrame:
171+
A DataFrame representing results of the query or table.
171172
"""
172173
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/pandas/io/parsers/readers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ def read_csv(
152152
keyword arguments for `pandas.read_csv` when not using the BigQuery engine.
153153
154154
Returns:
155-
bigframes.pandas.DataFrame: A BigQuery DataFrames.
155+
bigframes.pandas.DataFrame:
156+
A BigQuery DataFrames.
156157
157158
Raises:
158159
bigframes.exceptions.DefaultIndexWarning:

0 commit comments

Comments
 (0)