Skip to content

Commit

Permalink
Merge pull request #290 from vertica/nocode_ui_pages_update_17
Browse files Browse the repository at this point in the history
QueryProfiler Main Page - fixed query separation
  • Loading branch information
mail4umar authored Aug 29, 2024
2 parents ab823b2 + 5981cfa commit 3bcd7fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
11 changes: 6 additions & 5 deletions project/ui/qprof-ui.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,6 @@
"source": [
"# Loading display settings\n",
"\n",
"# Default\n",
"vp.set_option(\"insert_comma_numbers\", True)\n",
"vp.set_option(\"max_rows\", 2000)\n",
"# Saved\n",
"with output_initial:\n",
" # Attempt to load stored variables\n",
Expand Down Expand Up @@ -199,6 +196,8 @@
" vp.set_option(\"footer_on\", footer_widget_val)\n",
" if comma_widget_val is not None:\n",
" vp.set_option(\"insert_comma_numbers\", comma_widget_val)\n",
" else:\n",
" vp.set_option(\"insert_comma_numbers\", True)\n",
" if percent_bar_widget_val is not None:\n",
" vp.set_option(\"percent_bar\", percent_bar_widget_val)\n",
" if max_cell_width_widget_val is not None:\n",
Expand All @@ -207,6 +206,8 @@
" vp.set_option(\"max_columns\", max_columns_widget_val)\n",
" if max_rows_widget_val is not None:\n",
" vp.set_option(\"max_rows\", max_rows_widget_val)\n",
" else:\n",
" vp.set_option(\"max_rows\", 20000)\n",
" except Exception as e:\n",
" print(e)\n"
]
Expand Down Expand Up @@ -1371,7 +1372,7 @@
")\n",
"max_columns_widget.style.description_width = '240px'\n",
"max_rows_widget = widgets.BoundedIntText(\n",
" value=2000,\n",
" value=20000,\n",
" min=1,\n",
" max=4000,\n",
" step=1,\n",
Expand Down Expand Up @@ -1557,7 +1558,7 @@
"</head>\n",
"<body>\n",
" <div class=\"version\">\n",
" Page version update date: 8/22/2024\n",
" Page version update date: 8/28/2024\n",
" </div>\n",
"</body>\n",
"</html>"
Expand Down
5 changes: 3 additions & 2 deletions project/ui/qprof_main.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -572,11 +572,12 @@
"\n",
"# Split the queries\n",
"def query_list(sql_queries: str):\n",
" # Regular expression to match semicolons outside of quotes\n",
" pattern = r'''(?<![\"']).*?(?:(?<!\\\\)\";|$)'''\n",
" # Regular expression to match SQL queries\n",
" pattern = r'((?:[^;\"\\']|\"(?:\\\\.|[^\"])*\"|\\'(?:\\\\.|[^\\'])*\\')+);?\\s*'\n",
" queries = [query.strip() for query in re.findall(pattern, sql_queries) if query.strip()]\n",
" return queries\n",
"\n",
"\n",
"# Check if there is at least one space inside the query - to avoid the \";;\" typo mistake.\n",
"def query_check(queries: list):\n",
" for query in queries:\n",
Expand Down

0 comments on commit 3bcd7fb

Please sign in to comment.