assign, isflagged, strange bug
x; flagGeneric(func= isflagged(THL_0211_AIR_HUMIDITY) | isflagged(THL_0211_AIR_TEMPERATURE)); False
THL_0211_AIR_TEMPERATURE; flagGeneric(func=isflagged(x))
fails with KeyError
, but runs perfectly fine if Plot is set to True
(hahahahaha
Trachback:
Traceback (most recent call last):
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2657, in get_loc
return self._engine.get_loc(key)
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'x'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/palmb/virtualenvs/gcefscripts/src/saqc/saqc/core/core.py", line 141, in run
func, data=data_chunk, field=varname, flagger=flagger_chunk, nodata=nodata,
File "/home/palmb/virtualenvs/gcefscripts/src/saqc/saqc/core/evaluator/evaluator.py", line 74, in evalExpression
data_result, flagger_result = evalCode(code, FUNC_MAP, local_env)
File "/home/palmb/virtualenvs/gcefscripts/src/saqc/saqc/core/evaluator/evaluator.py", line 57, in evalCode
return eval(code, global_env or {}, local_env or {})
File "<ast>", line 1, in <module>
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/pandas/core/frame.py", line 2927, in __getitem__
indexer = self.columns.get_loc(key)
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2659, in get_loc
return self._engine.get_loc(self._maybe_cast_indexer(key))
File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 132, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 1601, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 1608, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'x'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/palmb/projects/gcefscripts/param_saqc.py", line 52, in <module>
main()
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/palmb/.virtualenvs/gcefscripts/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/palmb/projects/gcefscripts/param_saqc.py", line 37, in main
error_policy="raise" if fail else "warn"
File "/home/palmb/virtualenvs/gcefscripts/src/saqc/saqc/core/core.py", line 144, in run
_handleErrors(e, configrow, func, error_policy)
File "/home/palmb/virtualenvs/gcefscripts/src/saqc/saqc/core/core.py", line 69, in _handleErrors
raise Exception(msg)
Exception: config, line 7, test: 'flagGeneric(func=isflagged(x))' failed with:
KeyError: 'x'
Process finished with exit code 1