Skip to content

async client does not support explicit routing #2091

@daniel-sanche

Description

@daniel-sanche

A python-datastore user recently reported that the async client is missing some routing headers added to the sync client, making it unusable

Sync (link):

header_params = {}

if request.project_id:
    header_params["project_id"] = request.project_id

if request.database_id:
    header_params["database_id"] = request.database_id

if header_params:
    metadata = tuple(metadata) + (
        gapic_v1.routing_header.to_grpc_metadata(header_params),
    )

Async (link):

metadata = tuple(metadata) + (
    gapic_v1.routing_header.to_grpc_metadata(
        (("project_id", request.project_id),)
    ),
)

Metadata

Metadata

Assignees

Labels

priority: p2Moderately-important priority. Fix may not be included in next release.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