1212# See the License for the specific language governing permissions and
1313# limitations under the License.
1414
15+ import os
16+
1517import pytest
1618
1719
18- @pytest .mark .skip (reason = "Documentation sample code snippet (b/522845525)" )
1920def test_query_standard_sql ():
2021 # [START bigquery_bigframes_query]
2122 import bigframes .pandas as bpd
@@ -33,13 +34,17 @@ def test_query_standard_sql():
3334 df = bpd .read_gbq (sql )
3435
3536 # Run a query after explicitly specifying a project.
36- bpd .options .bigquery .project = "your-project-id"
37+ project = "your-project-id"
38+ # [END bigquery_bigframes_query]
39+ project = os .environ .get ("GOOGLE_CLOUD_PROJECT" , "bigframes-dev-perf" )
40+ bpd .close_session ()
41+ # [START bigquery_bigframes_query]
42+ bpd .options .bigquery .project = project
3743 df = bpd .read_gbq (sql )
3844 # [END bigquery_bigframes_query]
39- return df
45+ assert df is not None
4046
4147
42- @pytest .mark .skip (reason = "Documentation sample code snippet (b/522845525)" )
4348def test_query_legacy_sql ():
4449 # [START bigquery_bigframes_query_legacy]
4550 import bigframes .pandas as bpd
@@ -57,10 +62,9 @@ def test_query_legacy_sql():
5762 query_config = {"query" : {"useLegacySql" : True }}
5863 df = bpd .read_gbq (sql , configuration = query_config )
5964 # [END bigquery_bigframes_query_legacy]
60- return df
65+ assert df is not None
6166
6267
63- @pytest .mark .skip (reason = "Documentation sample code snippet (b/522845525)" )
6468def test_query_bqstorage ():
6569 # [START bigquery_bigframes_query_bqstorage]
6670 import bigframes .pandas as bpd
@@ -81,10 +85,9 @@ def test_query_bqstorage():
8185 # automatically uses the BigQuery Storage API if installed.
8286 pandas_df = df .to_pandas ()
8387 # [END bigquery_bigframes_query_bqstorage]
84- return pandas_df
88+ assert pandas_df is not None
8589
8690
87- @pytest .mark .skip (reason = "Documentation sample code snippet (b/522845525)" )
8891def test_query_parameters ():
8992 # [START bigquery_bigframes_query_parameters]
9093 import bigframes .pandas as bpd
@@ -113,10 +116,10 @@ def test_query_parameters():
113116
114117 df = bpd .read_gbq (sql , configuration = query_config )
115118 # [END bigquery_bigframes_query_parameters]
116- return df
119+ assert df is not None
117120
118121
119- @pytest .mark .skip (reason = "Documentation sample code snippet (b/522845525)" )
122+ @pytest .mark .skip (reason = "Requires a writable table destination (b/522845525)" )
120123def test_upload_from_dataframe ():
121124 # [START bigquery_bigframes_upload_from_dataframe]
122125 import pandas as pd
0 commit comments