<p dir="auto"><strong>Migrated issue, originally created by Patrick Buxton</strong></p>
<p dir="auto">The error shown below is seen when testing a dialect with:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="    @property
    def json_type(self):
        return exclusions.closed()"><pre class="notranslate"><code class="notranslate">    @property
    def json_type(self):
        return exclusions.closed()
</code></pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="=================================== ERRORS ====================================
___________ ERROR at setup of JSONTest.test_crit_against_int_basic ____________
Traceback (most recent call last):
  File &quot;C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\pytestplugin.py&quot;, line 173, in pytest_runtest_setup
    class_setup(item.parent.parent)
  File &quot;C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\pytestplugin.py&quot;, line 206, in class_setup
    plugin_base.start_test_class(item.cls)
  File &quot;C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\plugin_base.py&quot;, line 452, in start_test_class
    _do_skips(cls)
  File &quot;C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\plugin_base.py&quot;, line 567, in _do_skips
    for config_obj in config.Config.all_configs()
  File &quot;C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\plugin_base.py&quot;, line 567, in &lt;genexpr&gt;
    for config_obj in config.Config.all_configs()
TypeError: 'NoneType' object is not iterable"><pre class="notranslate"><code class="notranslate">=================================== ERRORS ====================================
___________ ERROR at setup of JSONTest.test_crit_against_int_basic ____________
Traceback (most recent call last):
  File "C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\pytestplugin.py", line 173, in pytest_runtest_setup
    class_setup(item.parent.parent)
  File "C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\pytestplugin.py", line 206, in class_setup
    plugin_base.start_test_class(item.cls)
  File "C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\plugin_base.py", line 452, in start_test_class
    _do_skips(cls)
  File "C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\plugin_base.py", line 567, in _do_skips
    for config_obj in config.Config.all_configs()
  File "C:\Users\pat\Anaconda2\lib\site-packages\sqlalchemy\testing\plugin\plugin_base.py", line 567, in &lt;genexpr&gt;
    for config_obj in config.Config.all_configs()
TypeError: 'NoneType' object is not iterable
</code></pre></div>
<p dir="auto">I'm working on two dialects with this skip in place and it doesn't affect one of them, but I have seen that other people have also had this issue. (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="301980517" data-permission-text="Title is private" data-url="https://github.com/MonetDB/sqlalchemy-monetdb/issues/30" data-hovercard-type="issue" data-hovercard-url="/MonetDB/sqlalchemy-monetdb/issues/30/hovercard" href="https://github.com/MonetDB/sqlalchemy-monetdb/issues/30">MonetDB/sqlalchemy-monetdb#30</a>)</p>
<p dir="auto">The easiest way to reproduce will be to run the dialect tests:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="git clone git@github.com:PlaidCloud/sqlalchemy-hana.git
cd sqlalchemy-hana
git checkout identity_column
python setup.py test"><pre class="notranslate"><code class="notranslate">git clone git@github.com:PlaidCloud/sqlalchemy-hana.git
cd sqlalchemy-hana
git checkout identity_column
python setup.py test
</code></pre></div>
<p dir="auto">Just comment out line 62 in testing\provision.py if you don't have a HANA server to point at and you'll still get the error generated even if the tests fail.</p>
<p dir="auto"><strong>Migrated issue, originally created by jvanasco (<a href="https://github.com/jvanasco">@jvanasco</a>)</strong></p>
<p dir="auto">I recently realized some implementation details of <code class="notranslate">to_tsquery</code> that are incompatible with the docs I drafted and how sqlalchemy integrates it.</p>
<p dir="auto">Not sure how to handle this.</p>
<p dir="auto">I based the docs/examples on existing tests and text.  So we have this as the first bit of "Full Text Search"  ( <a href="http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#full-text-search" rel="nofollow">http://docs.sqlalchemy.org/en/latest/dialects/postgresql.html#full-text-search</a> )</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select([sometable.c.text.match(&quot;search string&quot;)])
SELECT text @@ to_tsquery('search string') FROM table"><pre class="notranslate"><code class="notranslate">select([sometable.c.text.match("search string")])
SELECT text @@ to_tsquery('search string') FROM table
</code></pre></div>
<p dir="auto">well, if we put this into psql...</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="badsql=&gt; select to_tsquery('search string') ;
ERROR:  syntax error in tsquery: &quot;search string&quot;"><pre class="notranslate"><code class="notranslate">badsql=&gt; select to_tsquery('search string') ;
ERROR:  syntax error in tsquery: "search string"
</code></pre></div>
<p dir="auto">that's because tsquery has a rigid enforcement of input.  text must either be tokenized and joined with acceptable operators :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select to_tsquery('cat &amp; rat');"><pre class="notranslate"><code class="notranslate">select to_tsquery('cat &amp; rat');
</code></pre></div>
<p dir="auto">be quoted :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select to_tsquery('''search string''');"><pre class="notranslate"><code class="notranslate">select to_tsquery('''search string''');
</code></pre></div>
<p dir="auto">or use the alternate function</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select plainto_tsquery('search string');"><pre class="notranslate"><code class="notranslate">select plainto_tsquery('search string');
</code></pre></div>
<p dir="auto">So, these are acceptable:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select to_tsquery('search &amp; string');
select to_tsquery('''search string''');
select plainto_tsquery('search string');"><pre class="notranslate"><code class="notranslate">select to_tsquery('search &amp; string');
select to_tsquery('''search string''');
select plainto_tsquery('search string');
</code></pre></div>
<p dir="auto">but this is not:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="select to_tsquery('search string');"><pre class="notranslate"><code class="notranslate">select to_tsquery('search string');
</code></pre></div>
<p dir="auto">I'm not sure the best way to handle this nuance in the docs.</p>
<p dir="auto">As far as the implementation detail goes...</p>
<p dir="auto">this creates issues with <code class="notranslate">Column.match</code>, because that generates (invalid) sql like this:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="table.column @@ to_tsquery('search string')"><pre class="notranslate"><code class="notranslate">table.column @@ to_tsquery('search string')
</code></pre></div>
<p dir="auto">not valid sql  like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="table.column @@ to_tsquery('''search string''')
table.column @@ plainto_tsquery('search string')"><pre class="notranslate"><code class="notranslate">table.column @@ to_tsquery('''search string''')
table.column @@ plainto_tsquery('search string')
</code></pre></div>
<p dir="auto">This is an annoying implementation detail , but the content/type of string will affect the function or format t search on.</p>
<p dir="auto">i thought about just regexing this into submission, but the multitude of possible operators and edge cases suggests that the text would need to be parsed for tokenization instead -- otherwise throwing in a bit of text that has an operator will function as a real operator and probably trigger an invalid syntax.</p>
<p dir="auto">i think the easiest scenario would be to replace match's <code class="notranslate">to_tsquery</code> with <code class="notranslate">plainto_tsquery</code></p>