geldata / geldata/gel-python

Issue with type hints in public API's

Offen
#596 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
415
Forks
50
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start with the public create_client and create_async_client entry points named in the issue, then identify the other exposed client APIs with similar optional parameters. Check their signatures with strict typing and linting tools; done means public APIs no longer report errors for parameters that default to None.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
api
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.