You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 2, 2024. It is now read-only.
Bad error reporting for unimplemented function value reference #60
Traceback (most recent call last):
File "examples/hello2.py", line 10, in <module>
print(weird())
File "~/miniconda3/envs/HPAT/lib/python3.6/site-packages/numba/dispatcher.py", line 348, in _compile_for_args
error_rewrite(e, 'typing')
File "~/miniconda3/envs/HPAT/lib/python3.6/site-packages/numba/dispatcher.py", line 315, in error_rewrite
reraise(type(e), e, None)
File "~/miniconda3/envs/HPAT/lib/python3.6/site-packages/numba/six.py", line 658, in reraise
raise value.with_traceback(tb)
numba.errors.TypingError: Failed in hpat mode pipeline (step: nopython frontend)
Undefined variable 'df', operation: $0.15, location: examples/hello2.py (7)
File "examples/hello2.py", line 7:
def weird():
df = pd.DataFrame({'A': np.ones(10), 'B': np.arange(10)})
^
But this is misleading. df is defined, the problem is that df.count method is unimplemented and when it's not called but the method value is referenced instead, such error is produced.
If df.count is changed to df.count() we get better error message:
NotImplementedError: Failed in hpat mode pipeline (step: convert DataFrames)
data frame function columns not implemented yet
HPAT could probably give a better error message in the first case.
Given this code:
Execution leads to this error:
But this is misleading.
dfis defined, the problem is thatdf.countmethod is unimplemented and when it's not called but the method value is referenced instead, such error is produced.If
df.countis changed todf.count()we get better error message:HPAT could probably give a better error message in the first case.