Skip to content

Commit 54a7769

Browse files
authored
fix: use isinstance() per E721, unpin flake8 (#1659)
* fix: use isinstance() per E721, unpin flake8 * change type assertion
1 parent 30f605d commit 54a7769

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

google/cloud/bigquery/client.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1895,7 +1895,7 @@ def _get_query_results(
18951895
extra_params: Dict[str, Any] = {"maxResults": 0}
18961896

18971897
if timeout is not None:
1898-
if type(timeout) == object:
1898+
if not isinstance(timeout, (int, float)):
18991899
timeout = _MIN_GET_QUERY_RESULTS_TIMEOUT
19001900
else:
19011901
timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)
@@ -3927,7 +3927,7 @@ def _list_rows_from_query_results(
39273927
}
39283928

39293929
if timeout is not None:
3930-
if type(timeout) == object:
3930+
if not isinstance(timeout, (int, float)):
39313931
timeout = _MIN_GET_QUERY_RESULTS_TIMEOUT
39323932
else:
39333933
timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)

noxfile.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,7 @@ def lint(session):
375375
serious code quality issues.
376376
"""
377377

378-
# Pin flake8 to 6.0.0
379-
# See https://github.com/googleapis/python-bigquery/issues/1635
380-
session.install("flake8==6.0.0", BLACK_VERSION)
378+
session.install("flake8", BLACK_VERSION)
381379
session.install("-e", ".")
382380
session.run("flake8", os.path.join("google", "cloud", "bigquery"))
383381
session.run("flake8", "tests")

0 commit comments

Comments
 (0)