nteract/papermill

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

Open

#806 aperta il 5 set 2024

Vedi su GitHub
 (0 commenti) (0 reazioni) (0 assegnatari)Python (402 fork)batch import
bughelp wanted

Metriche repository

Star
 (5381 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

🐛 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

Guida contributor