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

fix: include io.IOBase in the PathType - #2323

Merged
tswast merged 1 commit into
googleapis:mainfrom
sycai:sycai_type_fix
Oct 15, 2025
Merged

fix: include io.IOBase in the PathType#2323
tswast merged 1 commit into
googleapis:mainfrom
sycai:sycai_type_fix

Conversation

@sycai

@sycaisycai commented Oct 15, 2025

Copy link
Copy Markdown
Contributor

Add io.IOBase to the PathType.

Reasons:

There's no reason that PathType in the GitHub version does not include io.IOBase

fix: #452403174 🦕

@sycai
sycai requested review from a team and chalmerloweOctober 15, 2025 21:11
@product-auto-labelproduct-auto-labelBot added size: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Oct 15, 2025
@sycaisycai changed the title fix: include in thefix: include io.IOBase in the PathTypeOct 15, 2025
@sycai
sycai requested a review from tswastOctober 15, 2025 21:12
@tswasttswast added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 15, 2025
@tswast
tswast enabled auto-merge (squash) October 15, 2025 21:18
@yoshi-kokoroyoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 15, 2025
@tswast

Copy link
Copy Markdown
Contributor

System test failure appears unrelated.

> raise job_failed_exception
E google.api_core.exceptions.BadRequest: 400 Invalid time travel timestamp 1760563108085 for table precise-truck-742:python_bigquery_tests_system_20251015211803_b7c892.t539. Cannot read before 1760563108092; reason: invalid, message: Invalid time travel timestamp 1760563108085 for table precise-truck-742:python_bigquery_tests_system_20251015211803_b7c892.t539. Cannot read before 1760563108092
E E Location: US
E Job ID: 73d9ea26-f5c7-40c3-a755-71482deaa235
google/cloud/bigquery/job/query.py:1722: BadRequest
_________________________ test_query_retry_539[False] __________________________
[gw1] linux -- Python 3.13.8 /tmpfs/src/github/python-bigquery/.nox/system-3-13/bin/python
bigquery_client = dataset_id = 'python_bigquery_tests_system_20251015211803_b7c892'
job_retry_on_query = False
@pytest.mark.parametrize("job_retry_on_query", [True, False])
def test_query_retry_539(bigquery_client, dataset_id, job_retry_on_query):
"""
Test job_retry
See: https://github.com/googleapis/python-bigquery/issues/539
"""
from google.api_core import exceptions
from google.api_core.retry import if_exception_type, Retry
table_name = f"{dataset_id}.t539"
# Without a custom retry, we fail:
> with pytest.raises(google.api_core.exceptions.NotFound):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE tests/system/test_job_retry.py:43: Failed
=============================== warnings summary ===============================
tests/system/test_client.py::TestBigQuery::test_create_table_with_default_value_expression
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:594: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
NOW = datetime.datetime.utcfromtimestamp(NOW_SECONDS).replace(tzinfo=UTC)
tests/system/test_client.py::TestBigQuery::test_dbapi_connection_does_not_leak_sockets
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:2094: DeprecationWarning: connections() is deprecated and will be removed; use net_connections() instead
conn_count_start = len(current_process.connections())
tests/system/test_client.py::TestBigQuery::test_dbapi_connection_does_not_leak_sockets
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:2112: DeprecationWarning: connections() is deprecated and will be removed; use net_connections() instead
conn_count_end = len(current_process.connections())
tests/system/test_client.py::TestBigQuery::test_close_releases_open_sockets
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:227: DeprecationWarning: connections() is deprecated and will be removed; use net_connections() instead
conn_count_start = len(current_process.connections())
tests/system/test_client.py::TestBigQuery::test_close_releases_open_sockets
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:243: DeprecationWarning: connections() is deprecated and will be removed; use net_connections() instead
conn_count_end = len(current_process.connections())
tests/system/test_client.py::TestBigQuery::test_dbapi_w_dml
/tmpfs/src/github/python-bigquery/google/cloud/bigquery/dbapi/cursor.py:212: FutureWarning: job_retry must be explicitly set to None if job_id is set.
BigQuery cannot retry a failed job by using the exact
same ID. Setting job_id without explicitly disabling
job_retry will raise an error in the future. To avoid this
warning, either use job_id_prefix instead (preferred) or
set job_retry=None.
rows = client.query(
tests/system/test_client.py::TestBigQuery::test_get_failed_job
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:1801: FutureWarning: job_retry must be explicitly set to None if job_id is set.
BigQuery cannot retry a failed job by using the exact
same ID. Setting job_id without explicitly disabling
job_retry will raise an error in the future. To avoid this
warning, either use job_id_prefix instead (preferred) or
set job_retry=None.
Config.CLIENT.query(QUERY, job_id=JOB_ID, job_config=job_config).result()
tests/system/test_client.py::TestBigQuery::test_insert_rows_then_dump_table
/tmpfs/src/github/python-bigquery/tests/system/test_client.py:1036: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
NOW = datetime.datetime.utcfromtimestamp(NOW_SECONDS).replace(tzinfo=UTC)
tests/system/test_magics.py::test_bigquery_magic
/tmpfs/src/github/python-bigquery/tests/system/test_magics.py:51: DeprecationWarning: connections() is deprecated and will be removed; use net_connections() instead
conn_count_start = len(current_process.connections())
tests/system/test_magics.py::test_bigquery_magic
/tmpfs/src/github/python-bigquery/tests/system/test_magics.py:71: DeprecationWarning: connections() is deprecated and will be removed; use net_connections() instead
conn_count_end = len(current_process.connections())
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/system/test_job_retry.py::test_query_retry_539[True] - google.ap...
FAILED tests/system/test_job_retry.py::test_query_retry_539[False] - Failed: ...

@tswast
tswast merged commit b11e09c into googleapis:mainOct 15, 2025
23 of 24 checks passed
@release-pleaserelease-pleaseBot mentioned this pull request Oct 15, 2025
daniel-sanche added a commit that referenced this pull request Dec 15, 2025
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.
Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:c8612d3fffb3f6a32353b2d1abd16b61e87811866f7ec9d65b59b02eb452a620
<details><summary>google-cloud-bigquery: 3.39.0</summary>
##
[3.39.0](v3.38.0...v3.39.0)
(2025-12-12)
### Features
* adds support for Python runtime 3.14 (#2322)
([6065e14](6065e14c))
* Add ExternalRuntimeOptions to BigQuery routine (#2311)
([fa76e31](fa76e310))
### Bug Fixes
* remove ambiguous error codes from query retries (#2308)
([8bbd3d0](8bbd3d01))
* include `io.Base` in the `PathType` (#2323)
([b11e09c](b11e09cb))
* honor custom `retry` in `job.result()` (#2302)
([e118b02](e118b029))
### Documentation
* remove experimental annotations from GA features (#2303)
([1f1f9d4](1f1f9d41))
</details>
Co-authored-by: Daniel Sanche <d.sanche14@gmail.com>
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.size: xsPull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sycai@tswast@shollyman@yoshi-kokoro