Skip to content

google-cloud-spanner: test_spanner_api_experimental_host fails with Python 3.14 #18117

Description

@glaubitz

Determine this is the right repository

  • I determined this is the correct repository in which to report this bug.

Summary of the issue

The test test_spanner_api_experimental_host fails with Python 3.14:

[   34s] =================================== FAILURES ===================================
[   34s] _______________ TestDatabase.test_spanner_api_experimental_host ________________
[   34s] 
[   34s] self = <test_database.TestDatabase testMethod=test_spanner_api_experimental_host>
[   34s] 
[   34s]     @CrossSync.pytest
[   34s]     async def test_spanner_api_experimental_host(self):
[   34s]         from google.cloud.spanner_v1.services.spanner.async_client import (
[   34s]             SpannerAsyncClient as SpannerClient,
[   34s]         )
[   34s]     
[   34s]         instance = _Instance(self.INSTANCE_NAME)
[   34s]         database = await self._make_one(self.DATABASE_ID, instance)
[   34s]         database._instance.experimental_host = "localhost:1234"
[   34s]         database._instance._client._use_plain_text = True
[   34s]         database._instance._client._ca_certificate = None
[   34s]         database._instance._client._client_certificate = None
[   34s]         database._instance._client._client_key = None
[   34s]     
[   34s]         # This will trigger spanner_api property to create a new one
[   34s]         database._spanner_api = None
[   34s] >       new_api = database.spanner_api
[   34s]                   ^^^^^^^^^^^^^^^^^^^^
[   34s] 
[   34s] tests/unit/_async/test_database.py:2474: 
[   34s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   34s] google/cloud/spanner_v1/_async/database.py:535: in spanner_api
[   34s]     self._spanner_api = SpannerClient(
[   34s] google/cloud/spanner_v1/services/spanner/async_client.py:278: in __init__
[   34s]     self._client = SpannerClient(
[   34s] google/cloud/spanner_v1/services/spanner/client.py:733: in __init__
[   34s]     self._transport = transport_init(
[   34s] google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py:360: in __init__
[   34s]     self._prep_wrapped_messages(client_info)
[   34s] google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py:988: in _prep_wrapped_messages
[   34s]     self.create_session: self._wrap_method(
[   34s] google/cloud/spanner_v1/services/spanner/transports/grpc_asyncio.py:1208: in _wrap_method
[   34s]     return gapic_v1.method_async.wrap_method(func, *args, **kwargs)
[   34s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   34s] /usr/lib/python3.14/site-packages/google/api_core/gapic_v1/method_async.py:54: in wrap_method
[   34s]     _GapicCallable(
[   34s] /usr/lib/python3.14/site-packages/google/api_core/gapic_v1/method.py:141: in __init__
[   34s]     self._x_goog_api_client, remaining = _extract_metrics_header(metadata)
[   34s]                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   34s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   34s] 
[   34s] metadata = [<coroutine object AsyncMockMixin._execute_mock_call at 0x7f47ea995340>]
[   34s] 
[   34s]     def _extract_metrics_header(metadata) -> Tuple[str, List[Tuple[str, str]]]:
[   34s]         """Extract x-google-api-client header from metadata list.
[   34s]     
[   34s]         Args:
[   34s]             metadata (Sequence[Tuple[str, str]]): The metadata to extract from.
[   34s]     
[   34s]         Returns:
[   34s]             A tuple containing:
[   34s]                 - a string representing the header value.
[   34s]                 - A sequence of remaining metadata tuples.
[   34s]         """
[   34s]         if not metadata:
[   34s]             return "", []
[   34s]     
[   34s]         key_to_find = client_info.METRICS_METADATA_KEY
[   34s]     
[   34s]         metric_str = _deduplicate_metadata_tokens(
[   34s] >           " ".join([v for k, v in metadata if k == key_to_find])
[   34s]                             ^^^^
[   34s]         )
[   34s] E       TypeError: cannot unpack non-iterable coroutine object
[   34s] 
[   34s] /usr/lib/python3.14/site-packages/google/api_core/gapic_v1/method.py:98: TypeError
[   34s] =============================== warnings summary ===============================

Metadata

Metadata

Assignees

No one assigned

    Labels

    triage meI really want to be triaged.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions