Open affvei opened 8 years ago
The issue here is panda's json_normalize, which somewhat oddly raises IndexError for empty lists:
>>> json_normalize([])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/bsmartt/Resources/tmp/ott/lib/python2.7/site-packages/pandas/io/json.py", line 707, in json_normalize
if any([isinstance(x, dict) for x in compat.itervalues(data[0])]):
IndexError: list index out of range
I suggest we update the notebook like this:
if events:
json_normalize(events)
I haven't been able to preview this on github yet it might be sufficient though: https://github.com/bsmartt13/OTX-Python-SDK/commit/6b230563d1cc3811ef280e60b08bce2d342357a6