vanna
vanna copied to clipboard
Edge cases for ask() when df has length 1 and print_result = False
src/vanna/init.py
Line 1525: return sql, df, fig, None
When df has length 1 and print_result = False, fig is not yet defined.
Thus, it will return the error:
Couldn't run plotly code: cannot access local variable 'fig' where it is not associated with a value Traceback (most recent call last): File "c:...\myenv\Lib\site-packages\vanna_init_.py", line 1525, in ask return sql, df, fig, None ^^^ UnboundLocalError: cannot access local variable 'fig' where it is not associated with a value
Need to take care of this case and return None instead of fig
Thanks for reporting! This is indeed a bug