googleapis / googleapis/google-cloud-python

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

Abierto
#13,820 8 comentarios 0 reacciones 1 asignado Reclamado por @chalmerlowe Ver en GitHub
type: feature request
Lenguaje dominante
Python
Estrellas
5.4k
Forks
1.8k
Merge medio
3 d 4 h
PR fusionados (30 d)
122

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.