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

DOC: Fixing EX01 - Added example #54126

Merged
merged 12 commits into from
Jul 18, 2023
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
pandas.api.extensions.ExtensionArray.tolist \
pandas.DataFrame.pad \
pandas.DataFrame.plot \
pandas.DataFrame.to_gbq \
pandas.DataFrame.__dataframe__
RET=$(($RET + $?)) ; echo $MSG "DONE"

Expand Down
22 changes: 22 additions & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2102,6 +2102,28 @@ def to_gbq(
--------
pandas_gbq.to_gbq : This function in the pandas-gbq library.
read_gbq : Read a DataFrame from Google BigQuery.

Examples
--------
Example taken from `Google BigQuery documentation
<https://cloud.google.com/bigquery/docs/samples/bigquery-pandas-gbq-to-gbq-simple>`_

# TODO: Set project_id to your Google Cloud Platform project ID.
>>> project_id = "my-project" # doctest: +SKIP
# TODO: Set table_id to the full destination table ID (including the
# dataset ID).
>>> table_id = 'my_dataset.my_table' # doctest: +SKIP
mroeschke marked this conversation as resolved.
Show resolved Hide resolved
>>> df = pd.DataFrame({
... "my_string": ["a", "b", "c"],
... "my_int64": [1, 2, 3],
... "my_float64": [4.0, 5.0, 6.0],
... "my_bool1": [True, False, True],
... "my_bool2": [False, True, False],
... "my_dates": pd.date_range("now", periods=3),
... }
... )

>>> df.to_gbq(table_id, project_id=project_id) # doctest: +SKIP
"""
from pandas.io import gbq

Expand Down
Loading