nteract/papermill

Python parameter with `None | ` union type is logged as unknown

Ouverte

#806 ouverte le 5 sept. 2024

 (0 commentaire) (0 réaction) (0 personne assignée)Python (402 forks)batch import
bughelp wanted

Métriques du dépôt

Stars
 (5 381 étoiles)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

Description

🐛 Bug

# template.ipynb parameters block
foo: None|str = None
$ papermill -p foo BAR ...
Passed unknown parameter: foo

Expected: this warning not to show up, foo should be recognized as a valid parameter.

Also note:

  • Despite the warning, the above example still properly injects the parameter value
  • Optional[str] does not suffer from this issue, just type union style
  • str|None (change the type order) produces the same warning log

papermill version == 2.6.0

Guide contributeur