Skip to content

Commit bf93e80

Browse files
authored
docs: Update docstrings of Session and related files (#1087)
* docs: Update docstrings * Remove extra empty lines * Remove extra line * Fix docstrings return type description
1 parent 2a0ffac commit bf93e80

File tree

5 files changed

+39
-6
lines changed

5 files changed

+39
-6
lines changed

bigframes/session/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,14 @@ def read_gbq_query(
477477
[2 rows x 3 columns]
478478
479479
See also: :meth:`Session.read_gbq`.
480+
481+
Returns:
482+
bigframes.pandas.DataFrame:
483+
A DataFrame representing results of the query or table.
484+
485+
Raises:
486+
ValueError:
487+
When both columns (preferred) and col_order are specified.
480488
"""
481489
# NOTE: This method doesn't (yet) exist in pandas or pandas-gbq, so
482490
# these docstrings are inline.
@@ -521,6 +529,14 @@ def read_gbq_table(
521529
>>> df = bpd.read_gbq_table("bigquery-public-data.ml_datasets.penguins")
522530
523531
See also: :meth:`Session.read_gbq`.
532+
533+
Returns:
534+
bigframes.pandas.DataFrame:
535+
A DataFrame representing results of the query or table.
536+
537+
Raises:
538+
ValueError:
539+
When both columns (preferred) and col_order are specified.
524540
"""
525541
# NOTE: This method doesn't (yet) exist in pandas or pandas-gbq, so
526542
# these docstrings are inline.
@@ -557,6 +573,10 @@ def read_gbq_table_streaming(
557573
>>> bpd.options.display.progress_bar = None
558574
559575
>>> sdf = bst.read_gbq_table("bigquery-public-data.ml_datasets.penguins")
576+
577+
Returns:
578+
bigframes.streaming.dataframe.StreamingDataFrame:
579+
A StreamingDataFrame representing results of the table.
560580
"""
561581
warnings.warn(
562582
"The bigframes.streaming module is a preview feature, and subject to change.",
@@ -654,6 +674,10 @@ def read_pandas(
654674
655675
Returns:
656676
An equivalent bigframes.pandas.(DataFrame/Series/Index) object
677+
678+
Raises:
679+
ValueError:
680+
When the object is not a Pandas DataFrame.
657681
"""
658682
import bigframes.series as series
659683

third_party/bigframes_vendored/pandas/io/gbq.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,6 @@ def read_gbq(
162162
or partitioned tables without primary keys.
163163
164164
Returns:
165-
bigframes.dataframe.DataFrame: A DataFrame representing results of the query or table.
165+
bigframes.pandas.DataFrame: A DataFrame representing results of the query or table.
166166
"""
167167
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/pandas/io/parquet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ def read_parquet(
4141
order is not preserved. Default, ``'auto'``.
4242
4343
Returns:
44-
bigframes.dataframe.DataFrame: A BigQuery DataFrames.
44+
bigframes.pandas.DataFrame: A BigQuery DataFrames.
4545
"""
4646
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,13 @@ def read_csv(
145145
**kwargs:
146146
keyword arguments for `pandas.read_csv` when not using the BigQuery engine.
147147
148-
149148
Returns:
150-
bigframes.dataframe.DataFrame: A BigQuery DataFrames.
149+
bigframes.pandas.DataFrame: A BigQuery DataFrames.
150+
151+
Raises:
152+
bigframes.exceptions.DefaultIndexWarning:
153+
Using the default index is discouraged, such as with clustered
154+
or partitioned tables without primary keys.
151155
"""
152156
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)
153157

@@ -226,7 +230,12 @@ def read_json(
226230
keyword arguments for `pandas.read_json` when not using the BigQuery engine.
227231
228232
Returns:
229-
bigframes.dataframe.DataFrame:
233+
bigframes.pandas.DataFrame:
230234
The DataFrame representing JSON contents.
235+
236+
Raises:
237+
bigframes.exceptions.DefaultIndexWarning:
238+
Using the default index is discouraged, such as with clustered
239+
or partitioned tables without primary keys.
231240
"""
232241
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

third_party/bigframes_vendored/pandas/io/pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def read_pickle(
6464
examples on storage options refer here.
6565
6666
Returns:
67-
bigframes.dataframe.DataFrame or bigframes.series.Series: same type as object
67+
bigframes.pandas.DataFrame or bigframes.pandas.Series: same type as object
6868
stored in file.
6969
"""
7070
raise NotImplementedError(constants.ABSTRACT_METHOD_ERROR_MESSAGE)

0 commit comments

Comments
 (0)