datagouv / hydra

Async metadata crawler for data.gouv.fr
3 stars 0 forks source link

fix: fix CLI typing #126

Closed bolinocroustibat closed 2 months ago

bolinocroustibat commented 3 months ago

Quick fix of types in CLI:

Detail :

Les hint types font crash certaines commandes CLI de mon côté, notamment analyse-csv, tu confirmes que ça fonctionne chez toi ?

Par exemple pour poetry run udata-hydra analyse-csv --url https://object.files.data.gouv.fr/meteofrance/data/synchro_ftp/BASE/HOR/H_03_1970-1979.csv.gz : Si je laisse

@cli(name="analyse-csv")
async def analyse_csv_cli(
    check_id: Union[int, None] = None, url: Union[str, None] = None, debug_insert: bool = False
):

ça plante (udata-hydra analyse-csv: error: argument --url/-u: invalid Optional value) (pareil avec Optional) Mais si je mets

... url: str = None, ...

ça passe

Pierlou commented 3 months ago

Following https://github.com/pyrates/minicli/pull/13 we can simply upgrade minicli to 0.5.3

bolinocroustibat commented 2 months ago

Following pyrates/minicli#13 we can simply upgrade minicli to 0.5.3

Amazing work solving that with library authors, thank you.

Just reverted the fix attempt commit and updated minicli to 0.5.3, let me know if that works for you.