Closed mail4umar closed 7 months ago
Below is the reproducer:
from verticapy.performance.vertica import QueryProfilerInterface qprof = QueryProfilerInterface( "SELECT * from public.titanic" ) qprof.get_qplan_tree()
Error:
--------------------------------------------------------------------------- ZeroDivisionError Traceback (most recent call last) File /usr/local/lib/python3.12/site-packages/ipywidgets/widgets/interaction.py:66, in interactive_output.<locals>.observer(change) 64 with out: 65 clear_output(wait=True) ---> 66 f(**kwargs) 67 show_inline_matplotlib_plots() File /usr/local/lib/python3.12/site-packages/verticapy/performance/vertica/qprof_interface.py:211, in QueryProfilerInterface.update_qplan_tree(self, metric, index, path_id, apply_tree_clicked) 209 display(box) 210 else: --> 211 raw = super().get_qplan_tree( 212 metric=metric, 213 path_id=path_id, 214 return_graphviz=True, 215 color_low=self.tree_style["color_low"], 216 color_high=self.tree_style["color_high"], 217 ) 218 output = read_package_file("html/index.html") 219 output = replace_value(output, "var dotSrc = [];", f"var dotSrc = `{raw}`;") File /usr/local/lib/python3.12/site-packages/verticapy/performance/vertica/qprof.py:2368, in QueryProfiler.get_qplan_tree(self, path_id, path_id_info, show_ancestors, metric, pic_path, return_graphviz, **tree_style) 2358 obj = PerformanceTree( 2359 rows, 2360 show_ancestors=show_ancestors, (...) 2365 style=tree_style, 2366 ) 2367 if return_graphviz: -> 2368 return obj.to_graphviz() 2369 return obj.plot_tree(pic_path) File /usr/local/lib/python3.12/site-packages/verticapy/performance/vertica/tree.py:1402, in PerformanceTree.to_graphviz(self) 1400 else: 1401 res += "\n" -> 1402 res += self._gen_labels() + "\n" 1403 res += self._gen_links() + "\n" 1404 res += "}" File /usr/local/lib/python3.12/site-packages/verticapy/performance/vertica/tree.py:1158, in PerformanceTree._gen_labels(self) 1156 operator_icon = self._get_operator_icon(row) 1157 if not (isinstance(self.metric[0], NoneType)): -> 1158 alpha = (all_metrics[i] - m_min) / (m_max - m_min) 1159 color = self._generate_gradient_color(alpha) 1160 else: ZeroDivisionError: float division by zero
What is the requested change?
Below is the reproducer:
Error: