Skip to content

Conversation

@sycai
Copy link
Contributor

@sycai sycai commented Oct 15, 2025

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 as code owners October 15, 2025 21:11
@sycai sycai requested a review from chalmerlowe October 15, 2025 21:11
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Oct 15, 2025
@sycai sycai changed the title fix: include in the fix: include io.IOBase in the PathType Oct 15, 2025
@sycai sycai requested a review from tswast October 15, 2025 21:12
@tswast tswast 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-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 15, 2025
@tswast
Copy link
Contributor

tswast commented Oct 15, 2025

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:main Oct 15, 2025
23 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery API. size: xs Pull request size is extra small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants