googleapis / googleapis/google-cloud-python

[config] Add validation to ConfigClient/ConfigAsyncClient to ensure the transport is compatible

未关闭
#13,820 8 条评论 0 个 reaction 已指派 1 人 已被 @chalmerlowe 认领 在 GitHub 查看
type: feature request
主要语言
Python
星标
5.4k
派生
1.8k
平均合并
3 天 4 小时
30 天内合并 PR
122

描述

### Determine this is the right repository

- [x] I determined this is the correct repository in which to report this feature request.

### Summary of the feature request

Since the `ConfigAsyncClient` appears to only correctly function with the `grpc_asyncio` transport, it would be useful to validate that the sync-or-async of the transport matches the sync-or-async of the Client.

### Desired code experience

file: main.py
```python
def my_ideal_error_checking():
ConfigClient(..., transport="grpc_asyncio") # ERROR
ConfigAsyncClient(..., transport="grpc") # ERROR
ConfigAsyncClient(..., transport="rest") # ERROR

ConfigAsyncClient(..., transport="grpc_asyncio") # Success!
```

### Expected results

Creating a `ConfigClient` with an async transport or creating a `ConfigAsyncClient` with a synchronous transport would raise an exception.

### API client name and version

google-cloud-config==0.1.17

### Use case

This will prevent unnecessary troubleshooting of later issues which arise from incompatible transports.

### Additional context

_No response_

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。