nteract/papermill

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

オープン

#806 opened on 2024/09/05

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Python (402 件のフォーク)batch import
bughelp wanted

Repository metrics

Stars
 (5,381 個のスター)
PR merge metrics
 (PR metrics pending)

説明

🐛 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

コントリビューターガイド