Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLN: Use
to_dataframe
to download query results.
This allows us to remove logic for parsing the schema and align with google-cloud-bigquery.
- Loading branch information
Showing
4 changed files
with
37 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# pandas-gbq benchmarks | ||
|
||
This directory contains a few scripts which are useful for performance | ||
testing the pandas-gbq library. Use cProfile to time the script and see | ||
details about where time is spent. To avoid timing how long BigQuery takes to | ||
execute a query, run the benchmark twice to ensure the results are cached. | ||
|
||
## `read_gbq` | ||
|
||
Read a small table (a few KB). | ||
|
||
python -m cProfile --sort=cumtime read_gbq_small_results.py | ||
|
||
Read a large-ish table (100+ MB). | ||
|
||
python -m cProfile --sort=cumtime read_gbq_large_results.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
import pandas_gbq | ||
|
||
# Select 163 MB worth of data, to time how long it takes to download large | ||
# result sets. | ||
df = pandas_gbq.read_gbq( | ||
"SELECT * FROM `bigquery-public-data.usa_names.usa_1910_2013`", | ||
dialect="standard") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
import pandas_gbq | ||
|
||
# Select a few KB worth of data, to time downloading small result sets. | ||
df = pandas_gbq.read_gbq( | ||
"SELECT * FROM `bigquery-public-data.utility_us.country_code_iso`", | ||
dialect="standard") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters