I am trying to create a small library using nbdev. I was able to successfully create two notebooks but, when I want to show some examples in index.ipynb, I get a weird NameError.
I import my notebook function like this:
from xapi_analysis.input_json import * from xapi_analysis.input_csv import *
And I get the following error:
32 print(json.dumps(statement, indent=indent))
34 # %% …/nbs/00_input_json.ipynb 12
35 def get_value(statement: dict, # Our xAPI statement imported from JSON
36 key: str # The key we are interested in
—> 37 ) → Union[str, dict, List, None]: # The value associated to the key in the statement
39 Return the value associated to the specified key in the statement dictionary.
40 If the key does not exist, returns None
42 if key in statement:
NameError: name ‘Union’ is not defined
But the same cell works fine if I run it from the other notebook, and I of course have a call to
from typing import Union
What am I missing here?