Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 14f51d3

Browse files
committed
revisions to numpy handling
1 parent d7560b4 commit 14f51d3

5 files changed

Lines changed: 8 additions & 5 deletions

File tree

noxfile.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ def unit_noextras(session):
163163
# so that it continues to be an optional dependency.
164164
# https://github.com/googleapis/python-bigquery/issues/1877
165165
if session.python == UNIT_TEST_PYTHON_VERSIONS[0]:
166-
session.install("pyarrow==4.0.0")
167-
166+
session.install("pyarrow==4.0.0", "numpy==1.20.2")
168167
default(session, install_extras=False)
169168

170169

testing/constraints-3.9.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ipykernel==6.2.0
2020
opentelemetry-api==1.1.0
2121
opentelemetry-instrumentation==0.20b0
2222
opentelemetry-sdk==1.1.0
23+
numpy==1.20.2
2324
packaging==24.2.0
2425
pandas==1.3.0
2526
pandas-gbq==0.26.1

tests/unit/test__pandas_helpers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
import datetime
1717
import decimal
1818
import functools
19-
import gc
19+
20+
# import gc
2021
import operator
2122
import queue
2223
from typing import Union
@@ -1887,6 +1888,7 @@ def fake_download_stream(
18871888
assert queue_used.maxsize == expected_maxsize
18881889

18891890

1891+
'''
18901892
@pytest.mark.skipif(isinstance(pyarrow, mock.Mock), reason="Requires `pyarrow`")
18911893
def test__download_table_bqstorage_shuts_down_workers(
18921894
monkeypatch,
@@ -2013,6 +2015,7 @@ def test_download_arrow_row_iterator_unknown_field_type(module_under_test):
20132015
col = result.columns[1]
20142016
assert type(col) is pyarrow.lib.DoubleArray
20152017
assert col.to_pylist() == [2.2, 22.22, 222.222]
2018+
'''
20162019

20172020

20182021
@pytest.mark.skipif(isinstance(pyarrow, mock.Mock), reason="Requires `pyarrow`")

tests/unit/test_dbapi__helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ def test_empty_iterable(self):
210210
self.assertEqual(list(result), [])
211211

212212
def test_non_empty_iterable(self):
213-
import numpy
213+
pytest.importorskip("numpy")
214214
pytest.importorskip("pyarrow")
215215
from tests.unit.helpers import _to_pyarrow
216216

tests/unit/test_table_arrow.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import google.cloud.bigquery.table
1919

2020

21-
import numpy
21+
numpy = pytest.importorskip("numpy")
2222
pyarrow = pytest.importorskip("pyarrow", minversion="3.0.0")
2323

2424

0 commit comments

Comments
 (0)