geldata / geldata/gel-python

Issue with type hints in public API's

Aperta
#596 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
415
Fork
50
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

There are some exposed functions, such as `create_async_client` and `create_client` whose type signature has some hints which are considered mistakes from many tools:
```python
def create_client(
dsn=None,
*,
max_concurrency=None,
host: str = None,
port: int = None,
credentials: str = None,
credentials_file: str = None,
user: str = None,
password: str = None,
secret_key: str = None,
database: str = None,
branch: str = None,
tls_ca: str = None,
tls_ca_file: str = None,
tls_security: str = None,
wait_until_available: int = 30,
timeout: int = 10,
):
```
A type which is not `T | None` cannot be assigned `None`, which causes this flurry of lints:

![Image](https://github.com/user-attachments/assets/a10fc93c-0350-4f38-b726-5262ba6c8a5e)

All public API's of the client should conform to strict typing in python to avoid consumers of the client to have to hack around their linting & LSP tooling.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.