Skip to content

Commit 0d91d09

Browse files
authored
DOC: Fixing EX01 - Added examples (#54164)
Example read_gbq
1 parent 0946a56 commit 0d91d09

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
9292
pandas.read_sas \
9393
pandas.read_spss \
9494
pandas.read_sql_query \
95-
pandas.read_gbq \
9695
pandas.io.stata.StataReader.data_label \
9796
pandas.io.stata.StataReader.value_labels \
9897
pandas.io.stata.StataReader.variable_labels \

pandas/io/gbq.py

+13
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,19 @@ def read_gbq(
162162
--------
163163
pandas_gbq.read_gbq : This function in the pandas-gbq library.
164164
DataFrame.to_gbq : Write a DataFrame to Google BigQuery.
165+
166+
Examples
167+
--------
168+
Example taken from `Google BigQuery documentation
169+
<https://cloud.google.com/bigquery/docs/pandas-gbq-migration>`_
170+
171+
>>> sql = "SELECT name FROM table_name WHERE state = 'TX' LIMIT 100;"
172+
>>> df = pd.read_gbq(sql, dialect="standard") # doctest: +SKIP
173+
>>> project_id = "your-project-id" # doctest: +SKIP
174+
>>> df = pd.read_gbq(sql,
175+
... project_id=project_id,
176+
... dialect="standard"
177+
... ) # doctest: +SKIP
165178
"""
166179
pandas_gbq = _try_import()
167180

0 commit comments

Comments
 (0)