Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
3b70891
chore: protect v3.x.x branch (#816)
tswast Jul 27, 2021
3c1be14
fix: no longer raise a warning in `to_dataframe` if `max_results` set…
plamut Jul 27, 2021
fe7a902
feat: Update proto definitions for bigquery/v2 to support new proto f…
gcf-owl-bot[bot] Jul 27, 2021
02bbdae
chore: release 2.23.0 (#819)
release-please[bot] Jul 27, 2021
42b66d3
chore(deps): update dependency google-cloud-bigquery to v2.23.0 (#820)
renovate-bot Jul 28, 2021
d9378af
fix: `insert_rows()` accepts float column values as strings again (#824)
plamut Jul 28, 2021
a505440
chore: release 2.23.1 (#825)
release-please[bot] Jul 28, 2021
c541c69
chore: add second protection rule for v3 branch (#828)
tswast Jul 28, 2021
48e8a35
chore(deps): update dependency google-cloud-bigquery to v2.23.1 (#827)
renovate-bot Jul 28, 2021
d8c25ac
test: retry getting rows after streaming them in `test_insert_rows_fr…
tswast Jul 29, 2021
8149d9e
chore(deps): update dependency pyarrow to v5 (#834)
renovate-bot Jul 29, 2021
b9349ad
chore(deps): update dependency google-cloud-bigquery-storage to v2.6.…
renovate-bot Jul 29, 2021
80e3a61
deps: expand pyarrow pins to support 5.x releases (#833)
plamut Jul 29, 2021
40ef77f
chore: release 2.23.2 (#835)
release-please[bot] Jul 29, 2021
55687b8
chore(deps): update dependency google-auth-oauthlib to v0.4.5 (#839)
renovate-bot Jul 29, 2021
85ce81c
chore(deps): update dependency google-cloud-bigquery to v2.23.2 (#838)
renovate-bot Jul 29, 2021
20df24b
chore(deps): update dependency google-cloud-testutils to v1 (#845)
renovate-bot Aug 3, 2021
7016f69
chore: require CODEOWNER review and up to date branches (#846)
busunkim96 Aug 3, 2021
cf0b0d8
chore: add api-bigquery as a samples owner (#852)
busunkim96 Aug 5, 2021
30770fd
fix: increase default retry deadline to 10 minutes (#859)
tswast Aug 6, 2021
e2cbcaa
process: add yoshi-python to samples CODEOWNERS (#858)
plamut Aug 6, 2021
9694a4d
chore: release 2.23.3 (#860)
release-please[bot] Aug 9, 2021
9c6614f
chore(deps): update dependency google-cloud-bigquery to v2.23.3 (#866)
renovate-bot Aug 9, 2021
7f7b1a8
feat: add support for transaction statistics (#849)
plamut Aug 10, 2021
443b8ab
chore(deps): update dependency google-cloud-bigquery-storage to v2.6.…
renovate-bot Aug 10, 2021
aee814c
chore: fix INSTALL_LIBRARY_FROM_SOURCE in noxfile.py (#869)
gcf-owl-bot[bot] Aug 11, 2021
c1a3d44
feat: make the same `Table*` instances equal to each other (#867)
plamut Aug 11, 2021
93d15e2
feat: support `ScalarQueryParameterType` for `type_` argument in `Sca…
tswast Aug 11, 2021
519d99c
feat: retry failed query jobs in `result()` (#837)
Aug 11, 2021
ad9c802
fix: make unicode characters working well in load_table_from_json (#865)
grimmerk Aug 11, 2021
cf6f0e9
chore: release 2.24.0 (#868)
release-please[bot] Aug 11, 2021
c44d45b
chore(deps): update dependency google-cloud-bigquery to v2.24.0 (#873)
renovate-bot Aug 12, 2021
e3704c3
test: refactor `list_rows` tests and add test for scalars (#829)
tswast Aug 13, 2021
cd21df1
chore: drop mention of Python 2.7 from templates (#877)
gcf-owl-bot[bot] Aug 13, 2021
2cb3563
fix: remove pytz dependency and require pyarrow>=3.0.0 (#875)
busunkim96 Aug 13, 2021
936660b
chore: release 2.24.1 (#879)
release-please[bot] Aug 19, 2021
5c5b4b8
chore(deps): update dependency google-cloud-bigquery to v2.24.1 (#887)
renovate-bot Aug 19, 2021
16f65e6
feat: Support using GeoPandas for GEOGRAPHY columns (#848)
Aug 24, 2021
aa4876e
test: Add test of datetime and time pandas load (#895)
Aug 24, 2021
f319d25
chore: release 2.25.0 (#898)
release-please[bot] Aug 24, 2021
fbbf72c
chore(deps): update dependency numpy to v1.21.2 (#899)
renovate-bot Aug 25, 2021
72a52f0
chore(deps): update dependency google-cloud-core to v2 (#904)
renovate-bot Aug 25, 2021
1cb3e55
fix: use REST API in cell magic when requested (#892)
plamut Aug 25, 2021
b508809
fix: populate default `timeout` and retry after client-side timeout (…
tswast Aug 25, 2021
4fc7c69
chore(deps): update dependency google-cloud-bigquery to v2.25.0 (#907)
renovate-bot Aug 25, 2021
121c2c2
chore(deps): update dependency pandas to v1.3.2 (#900)
renovate-bot Aug 25, 2021
a3a85da
chore: group all renovate PRs together (#911)
tswast Aug 25, 2021
109a536
chore: release 2.25.1 (#912)
release-please[bot] Aug 25, 2021
e2d12b7
docs: update docstring for bigquery_create_routine sample (#883) (#917)
plamut Aug 26, 2021
679e8ed
chore: migrate default branch to main (#910)
plamut Aug 26, 2021
4f229cb
chore: invalid docstrings broke docfx (#924)
Aug 27, 2021
8448922
chore(deps): update all dependencies (#914)
renovate-bot Aug 30, 2021
656d2fa
fix: error inserting DataFrame with REPEATED field (#925)
plamut Aug 31, 2021
bd417d3
chore(deps): update all dependencies (#926)
renovate-bot Aug 31, 2021
fcb0bc6
fix: underscores weren't allowed in struct field names when passing p…
Aug 31, 2021
936686b
chore: release 2.25.2 (#916)
release-please[bot] Sep 1, 2021
10fee52
chore(deps): update all dependencies (#928)
renovate-bot Sep 1, 2021
b289076
fix: guard imports against unsupported pyarrow versions (#934)
tswast Sep 1, 2021
ba02f24
feat: set the X-Server-Timeout header when timeout is set (#927)
Sep 1, 2021
db57c1c
chore: release 2.26.0 (#937)
release-please[bot] Sep 1, 2021
65cb29d
chore(deps): update dependency google-cloud-bigquery to v2.26.0 (#938)
renovate-bot Sep 2, 2021
1c2bd01
chore: update system tests and samples to use and @google.com email a…
Sep 2, 2021
c29c723
chore(python): rename default branch to main (#935)
gcf-owl-bot[bot] Sep 3, 2021
503d360
chore: Reduce duplicated code betweem tests/unit and tests/unit/job (…
Sep 3, 2021
e3b26d8
test: fix routine DDL sample test exits too early (#932)
plamut Sep 3, 2021
c9068e4
chore(deps): update all dependencies (#939)
renovate-bot Sep 3, 2021
eb1d8c4
Merge branch 'main' into sync-with-main
plamut Sep 6, 2021
ab7b2c0
Remove unneeded file
plamut Sep 6, 2021
4e3cc04
Remove unneeded legacy pyarrow import in noxfile
plamut Sep 9, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: retry getting rows after streaming them in `test_insert_rows_fr…
…om_dataframe` (#832)
  • Loading branch information
tswast authored Jul 29, 2021
commit d8c25ac139d53d0e689ee77ba46560dc63b4d9fa
40 changes: 26 additions & 14 deletions tests/system/test_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import io
import operator

import google.api_core.retry
import pkg_resources
import pytest
import pytz
Expand All @@ -41,6 +42,10 @@
PANDAS_INT64_VERSION = pkg_resources.parse_version("1.0.0")


class MissingDataError(Exception):
pass


def test_load_table_from_dataframe_w_automatic_schema(bigquery_client, dataset_id):
"""Test that a DataFrame with dtypes that map well to BigQuery types
can be uploaded without specifying a schema.
Expand Down Expand Up @@ -666,27 +671,34 @@ def test_insert_rows_from_dataframe(bigquery_client, dataset_id):
)
for errors in chunk_errors:
assert not errors

# Use query to fetch rows instead of listing directly from the table so
# that we get values from the streaming buffer.
rows = list(
bigquery_client.query(
"SELECT * FROM `{}.{}.{}`".format(
table.project, table.dataset_id, table.table_id
)
)
)

sorted_rows = sorted(rows, key=operator.attrgetter("int_col"))
row_tuples = [r.values() for r in sorted_rows]
expected = [
# Pandas often represents NULL values as NaN. Convert to None for
# easier comparison.
tuple(None if col != col else col for col in data_row)
for data_row in dataframe.itertuples(index=False)
]

assert len(row_tuples) == len(expected)
# Use query to fetch rows instead of listing directly from the table so
# that we get values from the streaming buffer "within a few seconds".
# https://cloud.google.com/bigquery/streaming-data-into-bigquery#dataavailability
@google.api_core.retry.Retry(
predicate=google.api_core.retry.if_exception_type(MissingDataError)
)
def get_rows():
rows = list(
bigquery_client.query(
"SELECT * FROM `{}.{}.{}`".format(
table.project, table.dataset_id, table.table_id
)
)
)
if len(rows) != len(expected):
raise MissingDataError()
return rows

rows = get_rows()
sorted_rows = sorted(rows, key=operator.attrgetter("int_col"))
row_tuples = [r.values() for r in sorted_rows]

for row, expected_row in zip(row_tuples, expected):
assert (
Expand Down