nteract/papermill

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

Open

#806 geöffnet am 5. Sept. 2024

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (402 Forks)batch import
bughelp wanted

Repository-Metriken

Stars
 (5.381 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

🐛 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

Contributor Guide