AutoViML / AutoViz

Automatically Visualize any dataset, any size with a single line of code. Created by Ram Seshadri. Collaborators Welcome. Permission Granted upon Request.
Apache License 2.0
1.7k stars 196 forks source link

UnboundLocalError in draw_distplot_hv Function #87

Closed yourcousinbob closed 1 year ago

yourcousinbob commented 1 year ago

Description:

I am attempting to run autoviz using a dataframe to generate directly to html files. It seems though the error is internal to some autoviz library. While running the AutoViz function in the autoviz module, an UnboundLocalError was encountered. This error arises due to the variable hv_panel being referenced before assignment in the draw_distplot_hv function.

The error stack trace is as follows:

2023-06-26 18:00:36.095 Uncaught app exception
Traceback (most recent call last):
  File "[redacted]/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "[redacted]__main__.py", line 4, in <module>
    run()
  File "[redacted]/interface.py", line 178, in run
    display_data(history["answer"], state["history"])
  File "[redacted]/interface.py", line 118, in display_data
    report = viz.AutoViz(filename="", dfte=data, verbose=2, save_plot_dir=PLOT_SAVE, chart_format="html")
  File "[redacted]/autoviz/AutoViz_Class.py", line 257, in AutoViz
    dft = AutoViz_Holo(filename, sep, depVar, dfte, header, verbose,
  File "[redacted]/autoviz/AutoViz_Holo.py", line 181, in AutoViz_Holo
    drawobj3 = draw_distplot_hv(dfin, cats, nums, chart_format, problem_type, dep, classes, mk_dir, verbose)
  File "[redacted]/autoviz/AutoViz_Holo.py", line 673, in draw_distplot_hv
    imgdata_list = append_panels(hv_panel, imgdata_list, chart_format)
UnboundLocalError: cannot access local variable 'hv_panel' where it is not associated with a value
AutoViML commented 1 year ago

I have fixed the error. Just upgrade to the latest version of autoviz by:

pip install autoviz --upgrade