Skip to content

Commit 366cb55

Browse files
feat: move bqstorage to extras and add debug capability (#735)
* feat: move bqstorage to extras and add debug capability * added some debug tactics to understand the recwarn variable * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * more debuggery * changed length of recwarn to account for tqdm warning * clean up some testing detritus * removes two out of date tests --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 41ee57d commit 366cb55

File tree

3 files changed

+6
-32
lines changed

3 files changed

+6
-32
lines changed

noxfile.py

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
UNIT_TEST_LOCAL_DEPENDENCIES = []
4747
UNIT_TEST_DEPENDENCIES = []
4848
UNIT_TEST_EXTRAS = [
49+
"bqstorage",
4950
"tqdm",
5051
]
5152
UNIT_TEST_EXTRAS_BY_PYTHON = {
@@ -177,6 +178,8 @@ def default(session):
177178
)
178179
install_unittest_dependencies(session, "-c", constraints_path)
179180

181+
session.run("python", "-m", "pip", "freeze")
182+
180183
# Run py.test against the unit tests.
181184
session.run(
182185
"py.test",

setup.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,12 @@
3737
# Please also update the minimum version in pandas_gbq/features.py to
3838
# allow pandas-gbq to detect invalid package versions at runtime.
3939
"google-cloud-bigquery >=3.3.5,<4.0.0dev",
40-
"google-cloud-bigquery-storage >=2.16.2,<3.0.0dev",
4140
"packaging >=20.0.0",
4241
]
4342
extras = {
43+
"bqstorage": [
44+
"google-cloud-bigquery-storage >=2.16.2, <3.0.0dev",
45+
],
4446
"tqdm": "tqdm>=4.23.0",
4547
}
4648

tests/unit/test_gbq.py

-31
Original file line numberDiff line numberDiff line change
@@ -222,37 +222,6 @@ def test_to_gbq_with_verbose_new_pandas_warns_deprecation(monkeypatch, verbose):
222222
pass
223223

224224

225-
def test_to_gbq_wo_verbose_w_new_pandas_no_warnings(monkeypatch, recwarn):
226-
monkeypatch.setattr(
227-
type(FEATURES),
228-
"pandas_has_deprecated_verbose",
229-
mock.PropertyMock(return_value=True),
230-
)
231-
try:
232-
gbq.to_gbq(DataFrame([[1]]), "dataset.tablename", project_id="my-project")
233-
except gbq.TableCreationError:
234-
pass
235-
assert len(recwarn) == 0
236-
237-
238-
def test_to_gbq_with_verbose_old_pandas_no_warnings(monkeypatch, recwarn):
239-
monkeypatch.setattr(
240-
type(FEATURES),
241-
"pandas_has_deprecated_verbose",
242-
mock.PropertyMock(return_value=False),
243-
)
244-
try:
245-
gbq.to_gbq(
246-
DataFrame([[1]]),
247-
"dataset.tablename",
248-
project_id="my-project",
249-
verbose=True,
250-
)
251-
except gbq.TableCreationError:
252-
pass
253-
assert len(recwarn) == 0
254-
255-
256225
def test_to_gbq_with_private_key_raises_notimplementederror():
257226
with pytest.raises(NotImplementedError, match="private_key"):
258227
gbq.to_gbq(

0 commit comments

Comments
 (0)