Skip to content

Commit

Permalink
Update look + fix bug (#1198)
Browse files Browse the repository at this point in the history
- Fix bug for no schema
- Update formatting for display
  • Loading branch information
mail4umar authored Mar 27, 2024
1 parent 798f8ff commit 6b7f3a2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion verticapy/performance/vertica/qprof.py
Original file line number Diff line number Diff line change
Expand Up @@ -2455,7 +2455,16 @@ def get_qplan_tree(
metric_value[me] = {}
for path_id_val, metric_val in res:
if not isinstance(metric_val, NoneType):
metric_value[me][path_id_val] = float(metric_val)
if me in [
"proc_rows",
"prod_rows",
"rows",
"rle_prod_rows",
"est_rows",
]: # Rows will always be integers
metric_value[me][path_id_val] = int(metric_val)
else:
metric_value[me][path_id_val] = float(metric_val)
else:
metric_value[me][path_id_val] = 0
obj = PerformanceTree(
Expand Down
4 changes: 2 additions & 2 deletions verticapy/performance/vertica/qprof_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def __init__(
self.query_display_info = widgets.HTML(
value=f"""
<b>Execution Time:</b> {self.get_qduration()} <br>
<b>Target Schema:</b> {self.target_schema["v_internal"]} <br>
<b>Target Schema:</b> {self.target_schema["v_internal"] if self.target_schema else ''} <br>
<b>Transaction ID:</b> {self.transaction_id} <br>
<b>Statement ID:</b> {self.statement_id} <br>
<b>Key ID:</b> {self.key_id}
Expand Down Expand Up @@ -317,7 +317,7 @@ def update_query_display(self):
self.query_display.children[0].value = current_query
self.query_display_info.value = f"""
<b>Execution Time:</b> {self.get_qduration()} <br>
<b>Target Schema:</b> {self.target_schema["v_internal"]} <br>
<b>Target Schema:</b> {self.target_schema["v_internal"] if self.target_schema else ''} <br>
<b>Transaction ID:</b> {self.transaction_id} <br>
<b>Statement ID:</b> {self.statement_id} <br>
<b>Key ID:</b> {self.key_id}
Expand Down
2 changes: 1 addition & 1 deletion verticapy/performance/vertica/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ def _gen_labels(self) -> str:
tooltip_metrics = "\n"
for j, x in enumerate(me):
me_j = QprofUtility._get_metrics_name(self.metric[j])
tooltip_metrics += f"\n{me_j}: {x[i]}"
tooltip_metrics += f"\n{me_j}: {format(x[i],',')}"
tree_id = self.path_order[i]
init_id = self.path_order[0]
info_bubble = self.path_order[-1] + 1 + tree_id
Expand Down

0 comments on commit 6b7f3a2

Please sign in to comment.