jwons / MultilingualProvenanceDebugger

GNU General Public License v3.0
2 stars 1 forks source link

ProvGrapher fails on edge case when there are no procedure nodes #8

Open fmnguyen opened 2 years ago

fmnguyen commented 2 years ago

When running prov.json files that have failed and do not have procedure nodes, ProvGrapher fails:

➜ python convert.py
./joe-new-test-data/datasets-doi-10-7910-DVN-EJYWCK-pagefocus/prov.json
/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvParser.py:117: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  retVal["label"] = pd.Series(labels, index = retVal.index)
/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvParser.py:117: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  retVal["label"] = pd.Series(labels, index = retVal.index)
/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvParser.py:117: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  retVal["label"] = pd.Series(labels, index = retVal.index)
/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvParser.py:117: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  retVal["label"] = pd.Series(labels, index = retVal.index)
/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvParser.py:117: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  retVal["label"] = pd.Series(labels, index = retVal.index)
/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvParser.py:117: FutureWarning: The default dtype for empty Series will be 'object' instead of 'float64' in a future version. Specify a dtype explicitly to silence this warning.
  retVal["label"] = pd.Series(labels, index = retVal.index)
Traceback (most recent call last):
  File "/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/pandas-1.4.0-py3.8-macosx-10.9-x86_64.egg/pandas/core/indexes/base.py", line 3621, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 136, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 163, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'from'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "convert.py", line 37, in <module>
    prov_explorer = pvd.Explorer(provFile)
  File "/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvExplorer.py", line 19, in __init__
    self.graph = Grapher(self.prov)
  File "/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/provdebug-0.41-py3.8.egg/provdebug/ProvGrapher.py", line 31, in __init__
    for edge in zip(edges["from"], edges["to"]):
  File "/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/pandas-1.4.0-py3.8-macosx-10.9-x86_64.egg/pandas/core/frame.py", line 3506, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/Users/FrancisNguyen/opt/anaconda3/envs/plover/lib/python3.8/site-packages/pandas-1.4.0-py3.8-macosx-10.9-x86_64.egg/pandas/core/indexes/base.py", line 3623, in get_loc
    raise KeyError(key) from err
KeyError: 'from'