Skip to content

Commit 7b6aecc

Browse files
committed
Modify test - *all* warnings should be pyarrow's
1 parent 52624b2 commit 7b6aecc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

bigquery/tests/unit/test_client.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5353,11 +5353,10 @@ def test_load_table_from_dataframe_w_schema_wo_pyarrow(self):
53535353
dataframe, self.TABLE_REF, job_config=job_config, location=self.LOCATION
53545354
)
53555355

5356-
# there might be other warnings unrelated to the expected pyarrow warning,
5357-
# thus some filtering is necessary
5358-
pyarrow_warning = next((w for w in warned if "pyarrow" in str(w)), None)
5359-
assert pyarrow_warning is not None
5360-
assert pyarrow_warning.category is PendingDeprecationWarning
5356+
assert warned # there should be at least one warning
5357+
for warning in warned:
5358+
assert "pyarrow" in str(warning)
5359+
assert warning.category in (DeprecationWarning, PendingDeprecationWarning)
53615360

53625361
load_table_from_file.assert_called_once_with(
53635362
client,

0 commit comments

Comments
 (0)