@@ -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 >
0 commit comments