Skip to content

Commit 5dc6bfa

Browse files
committed
Deploying to gh-pages from @ ba50a37 🚀
1 parent 8dbc859 commit 5dc6bfa

File tree

6 files changed

+350
-29
lines changed

6 files changed

+350
-29
lines changed

py/CHANGELOG.html

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,13 @@ <h2 id="toc-title">On this page</h2>
128128
<li><a href="#unreleased" id="toc-unreleased" class="nav-link" data-scroll-target="#unreleased">[UNRELEASED]</a>
129129
<ul class="collapse">
130130
<li><a href="#new-features" id="toc-new-features" class="nav-link" data-scroll-target="#new-features">New features</a></li>
131+
<li><a href="#improvements" id="toc-improvements" class="nav-link" data-scroll-target="#improvements">Improvements</a></li>
131132
</ul></li>
132133
<li><a href="#section" id="toc-section" class="nav-link" data-scroll-target="#section">[0.3.0] - 2025-12-10</a>
133134
<ul class="collapse">
134135
<li><a href="#breaking-changes" id="toc-breaking-changes" class="nav-link" data-scroll-target="#breaking-changes">Breaking Changes</a></li>
135136
<li><a href="#new-features-1" id="toc-new-features-1" class="nav-link" data-scroll-target="#new-features-1">New features</a></li>
136-
<li><a href="#improvements" id="toc-improvements" class="nav-link" data-scroll-target="#improvements">Improvements</a></li>
137+
<li><a href="#improvements-1" id="toc-improvements-1" class="nav-link" data-scroll-target="#improvements-1">Improvements</a></li>
137138
</ul></li>
138139
<li><a href="#section-1" id="toc-section-1" class="nav-link" data-scroll-target="#section-1">[0.2.2] - 2025-09-04</a></li>
139140
<li><a href="#section-2" id="toc-section-2" class="nav-link" data-scroll-target="#section-2">[0.2.1] - 2025-09-04</a></li>
@@ -164,6 +165,13 @@ <h3 class="anchored" data-anchor-id="new-features">New features</h3>
164165
<li><p>The tools used in a <code>QueryChat</code> chatbot are now configurable. Use the new <code>tools</code> parameter of <code>QueryChat()</code> to select either or both <code>"query"</code> or <code>"update"</code> tools. Choose <code>tools=["update"]</code> if you only want QueryChat to be able to update the dashboard (useful when you want to be 100% certain that the LLM will not see <em>any</em> raw data). (#168)</p></li>
165166
</ul>
166167
</section>
168+
<section id="improvements" class="level3">
169+
<h3 class="anchored" data-anchor-id="improvements">Improvements</h3>
170+
<ul>
171+
<li><p>The update tool now requires that the SQL query returns all columns from the original data source, ensuring that the dashboard can display the complete data frame after filtering or sorting. If the query does not return all columns, an informative error message will be provided. (#180)</p></li>
172+
<li><p>Obvious SQL keywords that lead to data modification (e.g., <code>INSERT</code>, <code>UPDATE</code>, <code>DELETE</code>, <code>DROP</code>, etc.) are now prohibited in queries run via the query tool or update tool, to prevent accidental data changes. If such keywords are detected, an informative error message will be provided. (#180)</p></li>
173+
</ul>
174+
</section>
167175
</section>
168176
<section id="section" class="level2">
169177
<h2 class="anchored" data-anchor-id="section">[0.3.0] - 2025-12-10</h2>
@@ -185,8 +193,8 @@ <h3 class="anchored" data-anchor-id="new-features-1">New features</h3>
185193
<li><p>Added <code>querychat_reset_dashboard()</code> tool for easily resetting the dashboard filters when asked by the user. (#81)</p></li>
186194
</ul>
187195
</section>
188-
<section id="improvements" class="level3">
189-
<h3 class="anchored" data-anchor-id="improvements">Improvements</h3>
196+
<section id="improvements-1" class="level3">
197+
<h3 class="anchored" data-anchor-id="improvements-1">Improvements</h3>
190198
<ul>
191199
<li><p>Added rich tool UI support using shinychat development version and chatlas &gt;= 0.11.1. (#67)</p></li>
192200
<li><p>querychat’s system prompt and tool descriptions were rewritten for clarity and future extensibility. (#90)</p></li>

py/reference/types.DataFrameSource.html

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ <h2 id="toc-title">On this page</h2>
290290
<li><a href="#querychat.types.DataFrameSource.get_data" id="toc-querychat.types.DataFrameSource.get_data" class="nav-link" data-scroll-target="#querychat.types.DataFrameSource.get_data">get_data</a></li>
291291
<li><a href="#querychat.types.DataFrameSource.get_db_type" id="toc-querychat.types.DataFrameSource.get_db_type" class="nav-link" data-scroll-target="#querychat.types.DataFrameSource.get_db_type">get_db_type</a></li>
292292
<li><a href="#querychat.types.DataFrameSource.get_schema" id="toc-querychat.types.DataFrameSource.get_schema" class="nav-link" data-scroll-target="#querychat.types.DataFrameSource.get_schema">get_schema</a></li>
293+
<li><a href="#querychat.types.DataFrameSource.test_query" id="toc-querychat.types.DataFrameSource.test_query" class="nav-link" data-scroll-target="#querychat.types.DataFrameSource.test_query">test_query</a></li>
293294
</ul></li>
294295
</ul></li>
295296
</ul>
@@ -335,6 +336,10 @@ <h2 class="anchored" data-anchor-id="methods">Methods</h2>
335336
<td><a href="#querychat.types.DataFrameSource.get_schema">get_schema</a></td>
336337
<td>Generate schema information from DataFrame.</td>
337338
</tr>
339+
<tr class="even">
340+
<td><a href="#querychat.types.DataFrameSource.test_query">test_query</a></td>
341+
<td>Test query by fetching only one row.</td>
342+
</tr>
338343
</tbody>
339344
</table>
340345
<section id="querychat.types.DataFrameSource.cleanup" class="level3">
@@ -410,6 +415,30 @@ <h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-1">
410415
</tbody>
411416
</table>
412417
</section>
418+
<section id="raises" class="level4 doc-section doc-section-raises">
419+
<h4 class="doc-section doc-section-raises anchored" data-anchor-id="raises">Raises</h4>
420+
<table class="caption-top table">
421+
<colgroup>
422+
<col style="width: 7%">
423+
<col style="width: 39%">
424+
<col style="width: 52%">
425+
</colgroup>
426+
<thead>
427+
<tr class="header">
428+
<th>Name</th>
429+
<th>Type</th>
430+
<th>Description</th>
431+
</tr>
432+
</thead>
433+
<tbody>
434+
<tr class="odd">
435+
<td></td>
436+
<td><code>UnsafeQueryError</code></td>
437+
<td>If the query starts with a disallowed SQL operation</td>
438+
</tr>
439+
</tbody>
440+
</table>
441+
</section>
413442
</section>
414443
<section id="querychat.types.DataFrameSource.get_data" class="level3">
415444
<h3 class="anchored" data-anchor-id="querychat.types.DataFrameSource.get_data">get_data</h3>
@@ -507,6 +536,91 @@ <h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-4">
507536
</tr>
508537
</tbody>
509538
</table>
539+
</section>
540+
</section>
541+
<section id="querychat.types.DataFrameSource.test_query" class="level3">
542+
<h3 class="anchored" data-anchor-id="querychat.types.DataFrameSource.test_query">test_query</h3>
543+
<div class="sourceCode" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>types.DataFrameSource.test_query(query, <span class="op">*</span>, require_all_columns<span class="op">=</span><span class="va">False</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
544+
<p>Test query by fetching only one row.</p>
545+
<section id="parameters-2" class="level4 doc-section doc-section-parameters">
546+
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-2">Parameters</h4>
547+
<table class="caption-top table">
548+
<thead>
549+
<tr class="header">
550+
<th>Name</th>
551+
<th>Type</th>
552+
<th>Description</th>
553+
<th>Default</th>
554+
</tr>
555+
</thead>
556+
<tbody>
557+
<tr class="odd">
558+
<td>query</td>
559+
<td><a href="https://docs.python.org/3/library/stdtypes.html#str">str</a></td>
560+
<td>SQL query to test</td>
561+
<td><em>required</em></td>
562+
</tr>
563+
<tr class="even">
564+
<td>require_all_columns</td>
565+
<td><a href="https://docs.python.org/3/library/functions.html#bool">bool</a></td>
566+
<td>If True, validates that result includes all original table columns</td>
567+
<td><code>False</code></td>
568+
</tr>
569+
</tbody>
570+
</table>
571+
</section>
572+
<section id="returns-5" class="level4 doc-section doc-section-returns">
573+
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-5">Returns</h4>
574+
<table class="caption-top table">
575+
<colgroup>
576+
<col style="width: 8%">
577+
<col style="width: 52%">
578+
<col style="width: 39%">
579+
</colgroup>
580+
<thead>
581+
<tr class="header">
582+
<th>Name</th>
583+
<th>Type</th>
584+
<th>Description</th>
585+
</tr>
586+
</thead>
587+
<tbody>
588+
<tr class="odd">
589+
<td></td>
590+
<td><code>pd</code>.<code>DataFrame</code></td>
591+
<td>Query results with at most one row</td>
592+
</tr>
593+
</tbody>
594+
</table>
595+
</section>
596+
<section id="raises-1" class="level4 doc-section doc-section-raises">
597+
<h4 class="doc-section doc-section-raises anchored" data-anchor-id="raises-1">Raises</h4>
598+
<table class="caption-top table">
599+
<colgroup>
600+
<col style="width: 5%">
601+
<col style="width: 46%">
602+
<col style="width: 48%">
603+
</colgroup>
604+
<thead>
605+
<tr class="header">
606+
<th>Name</th>
607+
<th>Type</th>
608+
<th>Description</th>
609+
</tr>
610+
</thead>
611+
<tbody>
612+
<tr class="odd">
613+
<td></td>
614+
<td><code>UnsafeQueryError</code></td>
615+
<td>If the query starts with a disallowed SQL operation</td>
616+
</tr>
617+
<tr class="even">
618+
<td></td>
619+
<td><code>MissingColumnsError</code></td>
620+
<td>If require_all_columns is True and result is missing required columns</td>
621+
</tr>
622+
</tbody>
623+
</table>
510624

511625

512626
</section>

py/reference/types.DataSource.html

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ <h2 id="toc-title">On this page</h2>
291291
<li><a href="#querychat.types.DataSource.get_data" id="toc-querychat.types.DataSource.get_data" class="nav-link" data-scroll-target="#querychat.types.DataSource.get_data">get_data</a></li>
292292
<li><a href="#querychat.types.DataSource.get_db_type" id="toc-querychat.types.DataSource.get_db_type" class="nav-link" data-scroll-target="#querychat.types.DataSource.get_db_type">get_db_type</a></li>
293293
<li><a href="#querychat.types.DataSource.get_schema" id="toc-querychat.types.DataSource.get_schema" class="nav-link" data-scroll-target="#querychat.types.DataSource.get_schema">get_schema</a></li>
294+
<li><a href="#querychat.types.DataSource.test_query" id="toc-querychat.types.DataSource.test_query" class="nav-link" data-scroll-target="#querychat.types.DataSource.test_query">test_query</a></li>
294295
</ul></li>
295296
</ul></li>
296297
</ul>
@@ -355,6 +356,10 @@ <h2 class="anchored" data-anchor-id="methods">Methods</h2>
355356
<td><a href="#querychat.types.DataSource.get_schema">get_schema</a></td>
356357
<td>Return schema information about the table as a string.</td>
357358
</tr>
359+
<tr class="even">
360+
<td><a href="#querychat.types.DataSource.test_query">test_query</a></td>
361+
<td>Test SQL query by fetching only one row.</td>
362+
</tr>
358363
</tbody>
359364
</table>
360365
<section id="querychat.types.DataSource.cleanup" class="level3">
@@ -509,6 +514,86 @@ <h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-3">
509514
</tr>
510515
</tbody>
511516
</table>
517+
</section>
518+
</section>
519+
<section id="querychat.types.DataSource.test_query" class="level3">
520+
<h3 class="anchored" data-anchor-id="querychat.types.DataSource.test_query">test_query</h3>
521+
<div class="sourceCode" id="cb7"><pre class="sourceCode python code-with-copy"><code class="sourceCode python"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>types.DataSource.test_query(query, <span class="op">*</span>, require_all_columns<span class="op">=</span><span class="va">False</span>)</span></code><button title="Copy to Clipboard" class="code-copy-button"><i class="bi"></i></button></pre></div>
522+
<p>Test SQL query by fetching only one row.</p>
523+
<section id="parameters-2" class="level4 doc-section doc-section-parameters">
524+
<h4 class="doc-section doc-section-parameters anchored" data-anchor-id="parameters-2">Parameters</h4>
525+
<table class="caption-top table">
526+
<thead>
527+
<tr class="header">
528+
<th>Name</th>
529+
<th>Type</th>
530+
<th>Description</th>
531+
<th>Default</th>
532+
</tr>
533+
</thead>
534+
<tbody>
535+
<tr class="odd">
536+
<td>query</td>
537+
<td><a href="https://docs.python.org/3/library/stdtypes.html#str">str</a></td>
538+
<td>SQL query to test</td>
539+
<td><em>required</em></td>
540+
</tr>
541+
<tr class="even">
542+
<td>require_all_columns</td>
543+
<td><a href="https://docs.python.org/3/library/functions.html#bool">bool</a></td>
544+
<td>If True, validates that result includes all original table columns. Additional computed columns are allowed.</td>
545+
<td><code>False</code></td>
546+
</tr>
547+
</tbody>
548+
</table>
549+
</section>
550+
<section id="returns-4" class="level4 doc-section doc-section-returns">
551+
<h4 class="doc-section doc-section-returns anchored" data-anchor-id="returns-4">Returns</h4>
552+
<table class="caption-top table">
553+
<colgroup>
554+
<col style="width: 7%">
555+
<col style="width: 42%">
556+
<col style="width: 50%">
557+
</colgroup>
558+
<thead>
559+
<tr class="header">
560+
<th>Name</th>
561+
<th>Type</th>
562+
<th>Description</th>
563+
</tr>
564+
</thead>
565+
<tbody>
566+
<tr class="odd">
567+
<td></td>
568+
<td><code>pd</code>.<code>DataFrame</code></td>
569+
<td>Query results as a pandas DataFrame with at most one row</td>
570+
</tr>
571+
</tbody>
572+
</table>
573+
</section>
574+
<section id="raises" class="level4 doc-section doc-section-raises">
575+
<h4 class="doc-section doc-section-raises anchored" data-anchor-id="raises">Raises</h4>
576+
<table class="caption-top table">
577+
<colgroup>
578+
<col style="width: 5%">
579+
<col style="width: 46%">
580+
<col style="width: 48%">
581+
</colgroup>
582+
<thead>
583+
<tr class="header">
584+
<th>Name</th>
585+
<th>Type</th>
586+
<th>Description</th>
587+
</tr>
588+
</thead>
589+
<tbody>
590+
<tr class="odd">
591+
<td></td>
592+
<td><code>MissingColumnsError</code></td>
593+
<td>If require_all_columns is True and result is missing required columns</td>
594+
</tr>
595+
</tbody>
596+
</table>
512597

513598

514599
</section>

0 commit comments

Comments
 (0)