googleapis / googleapis/google-cloud-python

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

Đang mở
#13,820 8 bình luận 0 reaction 1 người được giao Được @chalmerlowe nhận Xem trên GitHub
type: feature request
Ngôn ngữ chính
Python
Star
5.4k
Fork
1.8k
Merge trung bình
3 ngày 4 giờ
Pull request đã merge (30 ngày)
122

Mô tả

### 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_

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.