papermill icon indicating copy to clipboard operation
papermill copied to clipboard

NaN in output JSON

Open AlessioC31 opened this issue 4 years ago • 2 comments

🐛 Bug

When passing nan as a parameter for a notebook, even a simple one with only one cell with

print(parameter)

we get an output notebook with:

"metadata": {
  ...,
  "papermill": {
   "default_parameters": {},
   "duration": 1.086503,
   "end_time": "2021-09-16T08:05:29.914692",
   "environment_variables": {},
   "exception": null,
   "input_path": "test.ipynb",
   "output_path": "output.ipynb",
   "parameters": {
    "parameter": NaN
   },
  ...,
  }
 },

The problem is that NaN is not a valid JSON keyword, so when I try to open the .ipynb with Jupyter or any other notebooks interpreter, I get: Unable to open 'output.ipynb': Unexpected token N in JSON at position 2215.

AlessioC31 avatar Sep 16 '21 08:09 AlessioC31

Hi. What's your use case for wanting to use NaN as a parameter?

willingc avatar Sep 19 '21 02:09 willingc

Why not pass something else and then interpret it?

fny avatar Sep 17 '22 01:09 fny