<h3 dir="auto">Describe the bug</h3>
<p dir="auto">Looks like latest sphinx shows many warnings on generate documentation.</p>
<h3 dir="auto">To Reproduce</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="`sphinx-build -n -T -b html doc/build build/sphinx/html`"><pre class="notranslate"><span class="pl-s">`sphinx-build -n -T -b html doc/build build/sphinx/html`</span></pre></div>
<h3 dir="auto">Error</h3>
<p dir="auto">Willaadd in next comment.</p>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>OS: Linux x86/64</li>
<li>Python: 3.8.13</li>
<li>SQLAlchemy: 1.4.35</li>
<li>Database: N/A</li>
<li>DBAPI (eg: psycopg, cx_oracle, mysqlclient): N/A</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">list of modules with versions installed in build env</p>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
attrs                         21.4.0
Babel                         2.9.1
build                         0.7.0
changelog                     0.5.7
charset-normalizer            2.0.12
codespell                     2.1.0
cycler                        0.11.0
distro                        1.7.0
docutils                      0.17.1
execnet                       1.9.0
extras                        1.0.0
fixtures                      3.0.0
fonttools                     4.32.0
gpg                           1.17.1-unknown
greenlet                      1.1.2
idna                          3.3
imagesize                     1.3.0
importlib-metadata            4.11.3
iniconfig                     1.1.1
Jinja2                        3.1.1
kiwisolver                    1.3.2
libcomps                      0.1.18
libsass                       0.21.0
lit                           14.0.1
Mako                          1.2.0.dev0
MarkupSafe                    2.1.1
matplotlib                    3.5.1
meson                         0.62.0
numpy                         1.22.3
olefile                       0.46
packaging                     21.3
pbr                           5.8.1
pep517                        0.12.0
Pillow                        9.1.0
pip                           22.0.4
pluggy                        1.0.0
py                            1.11.0
Pygments                      2.11.2
PyGObject                     3.42.0
pyparsing                     3.0.8
pytest                        7.1.1
pytest-forked                 1.4.0
pytest-xdist                  2.5.0
python-dateutil               2.8.2
pytz                          2022.1
requests                      2.27.1
rpm                           4.17.0
setuptools                    62.0.0
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        4.5.0.dev20220404
sphinx-copybutton             0.4.0
sphinx-paramlinks             0.5.2
sphinxcontrib-applehelp       1.0.2.dev20220410
sphinxcontrib-devhelp         1.0.2.dev20220410
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220410
sphinxcontrib-qthelp          1.0.3.dev20220410
sphinxcontrib-serializinghtml 1.1.5
testtools                     2.5.0
tomli                         2.0.1
urllib3                       1.26.9
wheel                         0.37.1
zipp                          3.8.0
zzzeeksphinx                  1.3.3"><pre class="notranslate"><span class="pl-c1">Package                       Version</span>
<span class="pl-c1">----------------------------- -----------------</span>
<span class="pl-c1">alabaster                     0.7.12</span>
<span class="pl-c1">attrs                         21.4.0</span>
<span class="pl-c1">Babel                         2.9.1</span>
<span class="pl-c1">build                         0.7.0</span>
<span class="pl-c1">changelog                     0.5.7</span>
<span class="pl-c1">charset-normalizer            2.0.12</span>
<span class="pl-c1">codespell                     2.1.0</span>
<span class="pl-c1">cycler                        0.11.0</span>
<span class="pl-c1">distro                        1.7.0</span>
<span class="pl-c1">docutils                      0.17.1</span>
<span class="pl-c1">execnet                       1.9.0</span>
<span class="pl-c1">extras                        1.0.0</span>
<span class="pl-c1">fixtures                      3.0.0</span>
<span class="pl-c1">fonttools                     4.32.0</span>
<span class="pl-c1">gpg                           1.17.1-unknown</span>
<span class="pl-c1">greenlet                      1.1.2</span>
<span class="pl-c1">idna                          3.3</span>
<span class="pl-c1">imagesize                     1.3.0</span>
<span class="pl-c1">importlib-metadata            4.11.3</span>
<span class="pl-c1">iniconfig                     1.1.1</span>
<span class="pl-c1">Jinja2                        3.1.1</span>
<span class="pl-c1">kiwisolver                    1.3.2</span>
<span class="pl-c1">libcomps                      0.1.18</span>
<span class="pl-c1">libsass                       0.21.0</span>
<span class="pl-c1">lit                           14.0.1</span>
<span class="pl-c1">Mako                          1.2.0.dev0</span>
<span class="pl-c1">MarkupSafe                    2.1.1</span>
<span class="pl-c1">matplotlib                    3.5.1</span>
<span class="pl-c1">meson                         0.62.0</span>
<span class="pl-c1">numpy                         1.22.3</span>
<span class="pl-c1">olefile                       0.46</span>
<span class="pl-c1">packaging                     21.3</span>
<span class="pl-c1">pbr                           5.8.1</span>
<span class="pl-c1">pep517                        0.12.0</span>
<span class="pl-c1">Pillow                        9.1.0</span>
<span class="pl-c1">pip                           22.0.4</span>
<span class="pl-c1">pluggy                        1.0.0</span>
<span class="pl-c1">py                            1.11.0</span>
<span class="pl-c1">Pygments                      2.11.2</span>
<span class="pl-c1">PyGObject                     3.42.0</span>
<span class="pl-c1">pyparsing                     3.0.8</span>
<span class="pl-c1">pytest                        7.1.1</span>
<span class="pl-c1">pytest-forked                 1.4.0</span>
<span class="pl-c1">pytest-xdist                  2.5.0</span>
<span class="pl-c1">python-dateutil               2.8.2</span>
<span class="pl-c1">pytz                          2022.1</span>
<span class="pl-c1">requests                      2.27.1</span>
<span class="pl-c1">rpm                           4.17.0</span>
<span class="pl-c1">setuptools                    62.0.0</span>
<span class="pl-c1">six                           1.16.0</span>
<span class="pl-c1">snowballstemmer               2.2.0</span>
<span class="pl-c1">Sphinx                        4.5.0.dev20220404</span>
<span class="pl-c1">sphinx-copybutton             0.4.0</span>
<span class="pl-c1">sphinx-paramlinks             0.5.2</span>
<span class="pl-c1">sphinxcontrib-applehelp       1.0.2.dev20220410</span>
<span class="pl-c1">sphinxcontrib-devhelp         1.0.2.dev20220410</span>
<span class="pl-c1">sphinxcontrib-htmlhelp        2.0.0</span>
<span class="pl-c1">sphinxcontrib-jsmath          1.0.1.dev20220410</span>
<span class="pl-c1">sphinxcontrib-qthelp          1.0.3.dev20220410</span>
<span class="pl-c1">sphinxcontrib-serializinghtml 1.1.5</span>
<span class="pl-c1">testtools                     2.5.0</span>
<span class="pl-c1">tomli                         2.0.1</span>
<span class="pl-c1">urllib3                       1.26.9</span>
<span class="pl-c1">wheel                         0.37.1</span>
<span class="pl-c1">zipp                          3.8.0</span>
<span class="pl-c1">zzzeeksphinx                  1.3.3</span></pre></div>
<h3 dir="auto">Describe the bug</h3>
<p dir="auto">When reflecting indexes from one table to another in MariaDB, the index containing Text field can't be created as the retrieved index information in metadata does not contain the information about 'mysql_length'.</p>
<p dir="auto">mike-supplied MCVE</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sqlalchemy import Column
from sqlalchemy import create_engine
from sqlalchemy import Index
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import Table
from sqlalchemy import Text

metadata = MetaData()

test_table = Table(
    &quot;test_table&quot;,
    metadata,
    Column(&quot;signal_type&quot;, Integer(), nullable=False),
    Column(&quot;signal_data&quot;, Text(1 &lt;&lt; 18), nullable=False),
    Index(
        &quot;ix_test_table_0a574&quot;,
        *[&quot;signal_type&quot;, &quot;signal_data&quot;],
        mysql_length={&quot;signal_data&quot;: 256},
    )
)

e = create_engine(&quot;mysql://scott:tiger@localhost/test&quot;, echo=True)

metadata.drop_all(e)
metadata.create_all(e)

new_metadata = MetaData()
reflected_table = Table(&quot;test_table&quot;, new_metadata,autoload_with=e)

assert list(test_table.indexes)[0].kwargs['mysql_length'] == {&quot;signal_data&quot;: 256}
assert list(reflected_table.indexes)[0].kwargs['mysql_length'] == {&quot;signal_data&quot;: 256}"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Column</span>
<span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-s1">create_engine</span>
<span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Index</span>
<span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Integer</span>
<span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">MetaData</span>
<span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Table</span>
<span class="pl-k">from</span> <span class="pl-s1">sqlalchemy</span> <span class="pl-k">import</span> <span class="pl-v">Text</span>

<span class="pl-s1">metadata</span> <span class="pl-c1">=</span> <span class="pl-v">MetaData</span>()

<span class="pl-s1">test_table</span> <span class="pl-c1">=</span> <span class="pl-v">Table</span>(
    <span class="pl-s">"test_table"</span>,
    <span class="pl-s1">metadata</span>,
    <span class="pl-v">Column</span>(<span class="pl-s">"signal_type"</span>, <span class="pl-v">Integer</span>(), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>),
    <span class="pl-v">Column</span>(<span class="pl-s">"signal_data"</span>, <span class="pl-v">Text</span>(<span class="pl-c1">1</span> <span class="pl-c1">&lt;&lt;</span> <span class="pl-c1">18</span>), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>),
    <span class="pl-v">Index</span>(
        <span class="pl-s">"ix_test_table_0a574"</span>,
        <span class="pl-c1">*</span>[<span class="pl-s">"signal_type"</span>, <span class="pl-s">"signal_data"</span>],
        <span class="pl-s1">mysql_length</span><span class="pl-c1">=</span>{<span class="pl-s">"signal_data"</span>: <span class="pl-c1">256</span>},
    )
)

<span class="pl-s1">e</span> <span class="pl-c1">=</span> <span class="pl-en">create_engine</span>(<span class="pl-s">"mysql://scott:tiger@localhost/test"</span>, <span class="pl-s1">echo</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)

<span class="pl-s1">metadata</span>.<span class="pl-en">drop_all</span>(<span class="pl-s1">e</span>)
<span class="pl-s1">metadata</span>.<span class="pl-en">create_all</span>(<span class="pl-s1">e</span>)

<span class="pl-s1">new_metadata</span> <span class="pl-c1">=</span> <span class="pl-v">MetaData</span>()
<span class="pl-s1">reflected_table</span> <span class="pl-c1">=</span> <span class="pl-v">Table</span>(<span class="pl-s">"test_table"</span>, <span class="pl-s1">new_metadata</span>,<span class="pl-s1">autoload_with</span><span class="pl-c1">=</span><span class="pl-s1">e</span>)

<span class="pl-k">assert</span> <span class="pl-en">list</span>(<span class="pl-s1">test_table</span>.<span class="pl-s1">indexes</span>)[<span class="pl-c1">0</span>].<span class="pl-s1">kwargs</span>[<span class="pl-s">'mysql_length'</span>] <span class="pl-c1">==</span> {<span class="pl-s">"signal_data"</span>: <span class="pl-c1">256</span>}
<span class="pl-k">assert</span> <span class="pl-en">list</span>(<span class="pl-s1">reflected_table</span>.<span class="pl-s1">indexes</span>)[<span class="pl-c1">0</span>].<span class="pl-s1">kwargs</span>[<span class="pl-s">'mysql_length'</span>] <span class="pl-c1">==</span> {<span class="pl-s">"signal_data"</span>: <span class="pl-c1">256</span>}</pre></div>
<hr>
<p dir="auto">original issue</p>
<h3 dir="auto">To Reproduce</h3>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="sqlalchemy as sa

def get_engine(db_url):
    import logging

    logging.getLogger(&quot;sqlalchemy&quot;).setLevel(logging.ERROR)
    engine = sa.create_engine(db_url, isolation_level=&quot;READ_UNCOMMITTED&quot;)
    yield engine
    engine.dispose()

def get_metadata(engine) -&gt; sa.MetaData:
    metadata_obj = sa.MetaData()
    metadata_obj.reflect(bind=engine)
    return metadata_obj

def create_indices(engine):

    metadata_obj = get_metadata(engine)

    old_table = metadata_obj.tables[&quot;test_table&quot;]
    backup_table = metadata_obj.tables[&quot;test_table_backup&quot;]

    with engine.connect() as conn:
        for index in old_table.indexes:
            # the parent table must not be set in the Index constructor beforehand, because the index
            # will then be &quot;attached&quot; to the table object and will be created when calling table.create()
            print(index)
            index.table = None
            index._set_parent(backup_table)
            index.create(bind=conn)

def create_backup_table(engine, old_table_name: str):

    metadata = get_metadata(engine)

    old_table = metadata.tables[old_table_name]

    # duplicate table without indexes
    # we have a reason to do this, belive me
    backup_table = sa.Table(
        &quot;test_table_backup&quot;,
        metadata,
        *[column.copy() for column in old_table.columns],
    )

    with engine.connect() as conn:

        backup_table.create(conn, checkfirst=True)

    return backup_table

def create_old_table(engine):

    metadata = get_metadata(engine)
  
    old_table = sa.Table(
        &quot;test_table&quot;,
        metadata,
        sa.Column(&quot;signal_type&quot;, sa.Integer(), nullable=False),
        sa.Column(&quot;signal_data&quot;, sa.Text(1 &lt;&lt; 18), nullable=False),
        sa.Index(
            &quot;ix_test_table_0a574&quot;,
            *[&quot;signal_type&quot;, &quot;signal_data&quot;],
            mysql_length={&quot;signal_data&quot;: 256},
        )
    )

    with engine.connect() as connection:
        metadata.create_all(connection)

    return old_table

def example(engine):

    #cleanup of residual tables from previous test
    drop_table = sa.text(f&quot;DROP TABLE IF EXISTS test_table&quot;)
    engine.execute(drop_table)

    drop_table = sa.text(f&quot;DROP TABLE IF EXISTS test_table_backup&quot;)
    engine.execute(drop_table)

    create_old_table(engine)
    create_backup_table(engine, &quot;test_table&quot;)

    create_indices(engine)

if __name__ == &quot;__main__&quot;:

    example(get_engine(&quot;maradb_url&quot;))"><pre class="notranslate"><span class="pl-s1">sqlalchemy</span> <span class="pl-k">as</span> <span class="pl-s1">sa</span>

<span class="pl-k">def</span> <span class="pl-en">get_engine</span>(<span class="pl-s1">db_url</span>):
    <span class="pl-k">import</span> <span class="pl-s1">logging</span>

    <span class="pl-s1">logging</span>.<span class="pl-en">getLogger</span>(<span class="pl-s">"sqlalchemy"</span>).<span class="pl-en">setLevel</span>(<span class="pl-s1">logging</span>.<span class="pl-v">ERROR</span>)
    <span class="pl-s1">engine</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-en">create_engine</span>(<span class="pl-s1">db_url</span>, <span class="pl-s1">isolation_level</span><span class="pl-c1">=</span><span class="pl-s">"READ_UNCOMMITTED"</span>)
    <span class="pl-k">yield</span> <span class="pl-s1">engine</span>
    <span class="pl-s1">engine</span>.<span class="pl-en">dispose</span>()

<span class="pl-k">def</span> <span class="pl-en">get_metadata</span>(<span class="pl-s1">engine</span>) <span class="pl-c1">-&gt;</span> <span class="pl-s1">sa</span>.<span class="pl-v">MetaData</span>:
    <span class="pl-s1">metadata_obj</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-v">MetaData</span>()
    <span class="pl-s1">metadata_obj</span>.<span class="pl-en">reflect</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-s1">engine</span>)
    <span class="pl-k">return</span> <span class="pl-s1">metadata_obj</span>

<span class="pl-k">def</span> <span class="pl-en">create_indices</span>(<span class="pl-s1">engine</span>):

    <span class="pl-s1">metadata_obj</span> <span class="pl-c1">=</span> <span class="pl-en">get_metadata</span>(<span class="pl-s1">engine</span>)

    <span class="pl-s1">old_table</span> <span class="pl-c1">=</span> <span class="pl-s1">metadata_obj</span>.<span class="pl-s1">tables</span>[<span class="pl-s">"test_table"</span>]
    <span class="pl-s1">backup_table</span> <span class="pl-c1">=</span> <span class="pl-s1">metadata_obj</span>.<span class="pl-s1">tables</span>[<span class="pl-s">"test_table_backup"</span>]

    <span class="pl-k">with</span> <span class="pl-s1">engine</span>.<span class="pl-en">connect</span>() <span class="pl-k">as</span> <span class="pl-s1">conn</span>:
        <span class="pl-k">for</span> <span class="pl-s1">index</span> <span class="pl-c1">in</span> <span class="pl-s1">old_table</span>.<span class="pl-s1">indexes</span>:
            <span class="pl-c"># the parent table must not be set in the Index constructor beforehand, because the index</span>
            <span class="pl-c"># will then be "attached" to the table object and will be created when calling table.create()</span>
            <span class="pl-en">print</span>(<span class="pl-s1">index</span>)
            <span class="pl-s1">index</span>.<span class="pl-s1">table</span> <span class="pl-c1">=</span> <span class="pl-c1">None</span>
            <span class="pl-s1">index</span>.<span class="pl-en">_set_parent</span>(<span class="pl-s1">backup_table</span>)
            <span class="pl-s1">index</span>.<span class="pl-en">create</span>(<span class="pl-s1">bind</span><span class="pl-c1">=</span><span class="pl-s1">conn</span>)

<span class="pl-k">def</span> <span class="pl-en">create_backup_table</span>(<span class="pl-s1">engine</span>, <span class="pl-s1">old_table_name</span>: <span class="pl-s1">str</span>):

    <span class="pl-s1">metadata</span> <span class="pl-c1">=</span> <span class="pl-en">get_metadata</span>(<span class="pl-s1">engine</span>)

    <span class="pl-s1">old_table</span> <span class="pl-c1">=</span> <span class="pl-s1">metadata</span>.<span class="pl-s1">tables</span>[<span class="pl-s1">old_table_name</span>]

    <span class="pl-c"># duplicate table without indexes</span>
    <span class="pl-c"># we have a reason to do this, belive me</span>
    <span class="pl-s1">backup_table</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-v">Table</span>(
        <span class="pl-s">"test_table_backup"</span>,
        <span class="pl-s1">metadata</span>,
        <span class="pl-c1">*</span>[<span class="pl-s1">column</span>.<span class="pl-en">copy</span>() <span class="pl-k">for</span> <span class="pl-s1">column</span> <span class="pl-c1">in</span> <span class="pl-s1">old_table</span>.<span class="pl-s1">columns</span>],
    )

    <span class="pl-k">with</span> <span class="pl-s1">engine</span>.<span class="pl-en">connect</span>() <span class="pl-k">as</span> <span class="pl-s1">conn</span>:

        <span class="pl-s1">backup_table</span>.<span class="pl-en">create</span>(<span class="pl-s1">conn</span>, <span class="pl-s1">checkfirst</span><span class="pl-c1">=</span><span class="pl-c1">True</span>)

    <span class="pl-k">return</span> <span class="pl-s1">backup_table</span>

<span class="pl-k">def</span> <span class="pl-en">create_old_table</span>(<span class="pl-s1">engine</span>):

    <span class="pl-s1">metadata</span> <span class="pl-c1">=</span> <span class="pl-en">get_metadata</span>(<span class="pl-s1">engine</span>)
  
    <span class="pl-s1">old_table</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-v">Table</span>(
        <span class="pl-s">"test_table"</span>,
        <span class="pl-s1">metadata</span>,
        <span class="pl-s1">sa</span>.<span class="pl-v">Column</span>(<span class="pl-s">"signal_type"</span>, <span class="pl-s1">sa</span>.<span class="pl-v">Integer</span>(), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>),
        <span class="pl-s1">sa</span>.<span class="pl-v">Column</span>(<span class="pl-s">"signal_data"</span>, <span class="pl-s1">sa</span>.<span class="pl-v">Text</span>(<span class="pl-c1">1</span> <span class="pl-c1">&lt;&lt;</span> <span class="pl-c1">18</span>), <span class="pl-s1">nullable</span><span class="pl-c1">=</span><span class="pl-c1">False</span>),
        <span class="pl-s1">sa</span>.<span class="pl-v">Index</span>(
            <span class="pl-s">"ix_test_table_0a574"</span>,
            <span class="pl-c1">*</span>[<span class="pl-s">"signal_type"</span>, <span class="pl-s">"signal_data"</span>],
            <span class="pl-s1">mysql_length</span><span class="pl-c1">=</span>{<span class="pl-s">"signal_data"</span>: <span class="pl-c1">256</span>},
        )
    )

    <span class="pl-k">with</span> <span class="pl-s1">engine</span>.<span class="pl-en">connect</span>() <span class="pl-k">as</span> <span class="pl-s1">connection</span>:
        <span class="pl-s1">metadata</span>.<span class="pl-en">create_all</span>(<span class="pl-s1">connection</span>)

    <span class="pl-k">return</span> <span class="pl-s1">old_table</span>

<span class="pl-k">def</span> <span class="pl-en">example</span>(<span class="pl-s1">engine</span>):

    <span class="pl-c">#cleanup of residual tables from previous test</span>
    <span class="pl-s1">drop_table</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-en">text</span>(<span class="pl-s">f"DROP TABLE IF EXISTS test_table"</span>)
    <span class="pl-s1">engine</span>.<span class="pl-en">execute</span>(<span class="pl-s1">drop_table</span>)

    <span class="pl-s1">drop_table</span> <span class="pl-c1">=</span> <span class="pl-s1">sa</span>.<span class="pl-en">text</span>(<span class="pl-s">f"DROP TABLE IF EXISTS test_table_backup"</span>)
    <span class="pl-s1">engine</span>.<span class="pl-en">execute</span>(<span class="pl-s1">drop_table</span>)

    <span class="pl-en">create_old_table</span>(<span class="pl-s1">engine</span>)
    <span class="pl-en">create_backup_table</span>(<span class="pl-s1">engine</span>, <span class="pl-s">"test_table"</span>)

    <span class="pl-en">create_indices</span>(<span class="pl-s1">engine</span>)

<span class="pl-k">if</span> <span class="pl-s1">__name__</span> <span class="pl-c1">==</span> <span class="pl-s">"__main__"</span>:

    <span class="pl-en">example</span>(<span class="pl-en">get_engine</span>(<span class="pl-s">"maradb_url"</span>))</pre></div>
<h3 dir="auto">Error</h3>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="
self = &lt;sqlalchemy.engine.base.Connection object at 0x7fdbf37614c0&gt;, dialect = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLDialect_mysqldb object at 0x7fdbf370b730&gt;
constructor = &lt;bound method DefaultExecutionContext._init_ddl of &lt;class 'sqlalchemy.dialects.mysql.mysqldb.MySQLExecutionContext_mysqldb'&gt;&gt;
statement = 'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)', parameters = (), args = (&lt;sqlalchemy.dialects.mysql.base.MySQLDDLCompiler object at 0x7fdbf375bd30&gt;,)
conn = &lt;sqlalchemy.pool.base._ConnectionFairy object at 0x7fdbf3761be0&gt;, context = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLExecutionContext_mysqldb object at 0x7fdbf36f3d90&gt;

    def _execute_context(
        self, dialect, constructor, statement, parameters, *args
    ):
        &quot;&quot;&quot;Create an :class:`.ExecutionContext` and execute, returning
        a :class:`_engine.ResultProxy`.
    
        &quot;&quot;&quot;
    
        try:
            try:
                conn = self.__connection
            except AttributeError:
                # escape &quot;except AttributeError&quot; before revalidating
                # to prevent misleading stacktraces in Py3K
                conn = None
            if conn is None:
                conn = self._revalidate_connection()
    
            context = constructor(dialect, self, conn, *args)
        except BaseException as e:
            self._handle_dbapi_exception(
                e, util.text_type(statement), parameters, None, None
            )
    
        if context.compiled:
            context.pre_exec()
    
        cursor, statement, parameters = (
            context.cursor,
            context.statement,
            context.parameters,
        )
    
        if not context.executemany:
            parameters = parameters[0]
    
        if self._has_events or self.engine._has_events:
            for fn in self.dispatch.before_cursor_execute:
                statement, parameters = fn(
                    self,
                    cursor,
                    statement,
                    parameters,
                    context,
                    context.executemany,
                )
    
        if self._echo:
            self.engine.logger.info(statement)
            if not self.engine.hide_parameters:
                self.engine.logger.info(
                    &quot;%r&quot;,
                    sql_util._repr_params(
                        parameters, batches=10, ismulti=context.executemany
                    ),
                )
            else:
                self.engine.logger.info(
                    &quot;[SQL parameters hidden due to hide_parameters=True]&quot;
                )
    
        evt_handled = False
        try:
            if context.executemany:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_executemany:
                        if fn(cursor, statement, parameters, context):
                            evt_handled = True
                            break
                if not evt_handled:
                    self.dialect.do_executemany(
                        cursor, statement, parameters, context
                    )
            elif not parameters and context.no_parameters:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_execute_no_params:
                        if fn(cursor, statement, context):
                            evt_handled = True
                            break
                if not evt_handled:
                    self.dialect.do_execute_no_params(
                        cursor, statement, context
                    )
            else:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_execute:
                        if fn(cursor, statement, parameters, context):
                            evt_handled = True
                            break
                if not evt_handled:
&gt;                   self.dialect.do_execute(
                        cursor, statement, parameters, context
                    )

/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1276: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLDialect_mysqldb object at 0x7fdbf370b730&gt;, cursor = &lt;MySQLdb.cursors.Cursor object at 0x7fdbf375bf70&gt;
statement = 'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)', parameters = ()
context = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLExecutionContext_mysqldb object at 0x7fdbf36f3d90&gt;

    def do_execute(self, cursor, statement, parameters, context=None):
&gt;       cursor.execute(statement, parameters)

/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py:608: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;MySQLdb.cursors.Cursor object at 0x7fdbf375bf70&gt;, query = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)', args = ()

    def execute(self, query, args=None):
        &quot;&quot;&quot;Execute a query.
    
        query -- string, query to execute on server
        args -- optional sequence or mapping, parameters to use with query.
    
        Note: If args is a sequence, then %s must be used as the
        parameter placeholder in the query. If a mapping is used,
        %(key)s must be used as the placeholder.
    
        Returns integer represents rows affected, if any
        &quot;&quot;&quot;
        while self.nextset():
            pass
        db = self._get_db()
    
        if isinstance(query, str):
            query = query.encode(db.encoding)
    
        if args is not None:
            if isinstance(args, dict):
                nargs = {}
                for key, item in args.items():
                    if isinstance(key, str):
                        key = key.encode(db.encoding)
                    nargs[key] = db.literal(item)
                args = nargs
            else:
                args = tuple(map(db.literal, args))
            try:
                query = query % args
            except TypeError as m:
                raise ProgrammingError(str(m))
    
        assert isinstance(query, (bytes, bytearray))
&gt;       res = self._query(query)

/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:206: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;MySQLdb.cursors.Cursor object at 0x7fdbf375bf70&gt;, q = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)'

    def _query(self, q):
        db = self._get_db()
        self._result = None
&gt;       db.query(q)

/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:319: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;_mysql.connection open to 'afs-db-test' at 0x560bdcd86ad0&gt;, query = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)'

    def query(self, query):
        # Since _mysql releases GIL while querying, we need immutable buffer.
        if isinstance(query, bytearray):
            query = bytes(query)
&gt;       _mysql.connection.query(self, query)
E       MySQLdb._exceptions.OperationalError: (1170, &quot;BLOB/TEXT column 'signal_data' used in key specification without a key length&quot;)

/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py:259: OperationalError

The above exception was the direct cause of the following exception:

engine = Engine(mysql://root:***@afs-db-test/afs)

    def test(engine):
    
        #cleanup of residual tables from previous test
        drop_table = sa.text(f&quot;DROP TABLE IF EXISTS test_table&quot;)
        engine.execute(drop_table)
    
        drop_table = sa.text(f&quot;DROP TABLE IF EXISTS test_table_backup&quot;)
        engine.execute(drop_table)
    
        create_old_table(engine)
        create_backup_table(engine, &quot;test_table&quot;)
    
&gt;       create_indices(engine)

tests/tools/test_delete_me.py:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/tools/test_delete_me.py:30: in create_indices
    index.create(bind=conn)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/schema.py:4032: in create
    bind._run_visitor(ddl.SchemaGenerator, self)
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1656: in _run_visitor
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py:145: in traverse_single
    return meth(obj, **kw)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py:868: in visit_index
    self.connection.execute(CreateIndex(index))
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1011: in execute
    return meth(self, multiparams, params)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py:72: in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1068: in _execute_ddl
    ret = self._execute_context(
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1316: in _execute_context
    self._handle_dbapi_exception(
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1510: in _handle_dbapi_exception
    util.raise_(
/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py:182: in raise_
    raise exception
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1276: in _execute_context
    self.dialect.do_execute(
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py:608: in do_execute
    cursor.execute(statement, parameters)
/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:206: in execute
    res = self._query(query)
/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:319: in _query
    db.query(q)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;_mysql.connection open to 'afs-db-test' at 0x560bdcd86ad0&gt;, query = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)'

    def query(self, query):
        # Since _mysql releases GIL while querying, we need immutable buffer.
        if isinstance(query, bytearray):
            query = bytes(query)
&gt;       _mysql.connection.query(self, query)
E       sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1170, &quot;BLOB/TEXT column 'signal_data' used in key specification without a key length&quot;)
E       [SQL: CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)]
E       (Background on this error at: http://sqlalche.me/e/13/e3q8)

/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py:259: OperationalError
---------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------
Index('ix_test_table_0a574', Column('signal_type', INTEGER(display_width=11), table=&lt;test_table&gt;, nullable=False), Column('signal_data', MEDIUMTEXT(collation='utf8_czech_ci'), table=&lt;test_table&gt;, nullable=False))
"><pre class="notranslate"><code class="notranslate">
self = &lt;sqlalchemy.engine.base.Connection object at 0x7fdbf37614c0&gt;, dialect = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLDialect_mysqldb object at 0x7fdbf370b730&gt;
constructor = &lt;bound method DefaultExecutionContext._init_ddl of &lt;class 'sqlalchemy.dialects.mysql.mysqldb.MySQLExecutionContext_mysqldb'&gt;&gt;
statement = 'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)', parameters = (), args = (&lt;sqlalchemy.dialects.mysql.base.MySQLDDLCompiler object at 0x7fdbf375bd30&gt;,)
conn = &lt;sqlalchemy.pool.base._ConnectionFairy object at 0x7fdbf3761be0&gt;, context = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLExecutionContext_mysqldb object at 0x7fdbf36f3d90&gt;

    def _execute_context(
        self, dialect, constructor, statement, parameters, *args
    ):
        """Create an :class:`.ExecutionContext` and execute, returning
        a :class:`_engine.ResultProxy`.
    
        """
    
        try:
            try:
                conn = self.__connection
            except AttributeError:
                # escape "except AttributeError" before revalidating
                # to prevent misleading stacktraces in Py3K
                conn = None
            if conn is None:
                conn = self._revalidate_connection()
    
            context = constructor(dialect, self, conn, *args)
        except BaseException as e:
            self._handle_dbapi_exception(
                e, util.text_type(statement), parameters, None, None
            )
    
        if context.compiled:
            context.pre_exec()
    
        cursor, statement, parameters = (
            context.cursor,
            context.statement,
            context.parameters,
        )
    
        if not context.executemany:
            parameters = parameters[0]
    
        if self._has_events or self.engine._has_events:
            for fn in self.dispatch.before_cursor_execute:
                statement, parameters = fn(
                    self,
                    cursor,
                    statement,
                    parameters,
                    context,
                    context.executemany,
                )
    
        if self._echo:
            self.engine.logger.info(statement)
            if not self.engine.hide_parameters:
                self.engine.logger.info(
                    "%r",
                    sql_util._repr_params(
                        parameters, batches=10, ismulti=context.executemany
                    ),
                )
            else:
                self.engine.logger.info(
                    "[SQL parameters hidden due to hide_parameters=True]"
                )
    
        evt_handled = False
        try:
            if context.executemany:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_executemany:
                        if fn(cursor, statement, parameters, context):
                            evt_handled = True
                            break
                if not evt_handled:
                    self.dialect.do_executemany(
                        cursor, statement, parameters, context
                    )
            elif not parameters and context.no_parameters:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_execute_no_params:
                        if fn(cursor, statement, context):
                            evt_handled = True
                            break
                if not evt_handled:
                    self.dialect.do_execute_no_params(
                        cursor, statement, context
                    )
            else:
                if self.dialect._has_events:
                    for fn in self.dialect.dispatch.do_execute:
                        if fn(cursor, statement, parameters, context):
                            evt_handled = True
                            break
                if not evt_handled:
&gt;                   self.dialect.do_execute(
                        cursor, statement, parameters, context
                    )

/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1276: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLDialect_mysqldb object at 0x7fdbf370b730&gt;, cursor = &lt;MySQLdb.cursors.Cursor object at 0x7fdbf375bf70&gt;
statement = 'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)', parameters = ()
context = &lt;sqlalchemy.dialects.mysql.mysqldb.MySQLExecutionContext_mysqldb object at 0x7fdbf36f3d90&gt;

    def do_execute(self, cursor, statement, parameters, context=None):
&gt;       cursor.execute(statement, parameters)

/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py:608: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;MySQLdb.cursors.Cursor object at 0x7fdbf375bf70&gt;, query = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)', args = ()

    def execute(self, query, args=None):
        """Execute a query.
    
        query -- string, query to execute on server
        args -- optional sequence or mapping, parameters to use with query.
    
        Note: If args is a sequence, then %s must be used as the
        parameter placeholder in the query. If a mapping is used,
        %(key)s must be used as the placeholder.
    
        Returns integer represents rows affected, if any
        """
        while self.nextset():
            pass
        db = self._get_db()
    
        if isinstance(query, str):
            query = query.encode(db.encoding)
    
        if args is not None:
            if isinstance(args, dict):
                nargs = {}
                for key, item in args.items():
                    if isinstance(key, str):
                        key = key.encode(db.encoding)
                    nargs[key] = db.literal(item)
                args = nargs
            else:
                args = tuple(map(db.literal, args))
            try:
                query = query % args
            except TypeError as m:
                raise ProgrammingError(str(m))
    
        assert isinstance(query, (bytes, bytearray))
&gt;       res = self._query(query)

/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:206: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;MySQLdb.cursors.Cursor object at 0x7fdbf375bf70&gt;, q = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)'

    def _query(self, q):
        db = self._get_db()
        self._result = None
&gt;       db.query(q)

/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:319: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;_mysql.connection open to 'afs-db-test' at 0x560bdcd86ad0&gt;, query = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)'

    def query(self, query):
        # Since _mysql releases GIL while querying, we need immutable buffer.
        if isinstance(query, bytearray):
            query = bytes(query)
&gt;       _mysql.connection.query(self, query)
E       MySQLdb._exceptions.OperationalError: (1170, "BLOB/TEXT column 'signal_data' used in key specification without a key length")

/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py:259: OperationalError

The above exception was the direct cause of the following exception:

engine = Engine(mysql://root:***@afs-db-test/afs)

    def test(engine):
    
        #cleanup of residual tables from previous test
        drop_table = sa.text(f"DROP TABLE IF EXISTS test_table")
        engine.execute(drop_table)
    
        drop_table = sa.text(f"DROP TABLE IF EXISTS test_table_backup")
        engine.execute(drop_table)
    
        create_old_table(engine)
        create_backup_table(engine, "test_table")
    
&gt;       create_indices(engine)

tests/tools/test_delete_me.py:85: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/tools/test_delete_me.py:30: in create_indices
    index.create(bind=conn)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/schema.py:4032: in create
    bind._run_visitor(ddl.SchemaGenerator, self)
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1656: in _run_visitor
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/visitors.py:145: in traverse_single
    return meth(obj, **kw)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py:868: in visit_index
    self.connection.execute(CreateIndex(index))
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1011: in execute
    return meth(self, multiparams, params)
/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/ddl.py:72: in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1068: in _execute_ddl
    ret = self._execute_context(
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1316: in _execute_context
    self._handle_dbapi_exception(
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1510: in _handle_dbapi_exception
    util.raise_(
/usr/local/lib/python3.9/site-packages/sqlalchemy/util/compat.py:182: in raise_
    raise exception
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py:1276: in _execute_context
    self.dialect.do_execute(
/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/default.py:608: in do_execute
    cursor.execute(statement, parameters)
/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:206: in execute
    res = self._query(query)
/usr/local/lib/python3.9/site-packages/MySQLdb/cursors.py:319: in _query
    db.query(q)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = &lt;_mysql.connection open to 'afs-db-test' at 0x560bdcd86ad0&gt;, query = b'CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)'

    def query(self, query):
        # Since _mysql releases GIL while querying, we need immutable buffer.
        if isinstance(query, bytearray):
            query = bytes(query)
&gt;       _mysql.connection.query(self, query)
E       sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1170, "BLOB/TEXT column 'signal_data' used in key specification without a key length")
E       [SQL: CREATE INDEX ix_test_table_0a574 ON test_table_backup (signal_type, signal_data)]
E       (Background on this error at: http://sqlalche.me/e/13/e3q8)

/usr/local/lib/python3.9/site-packages/MySQLdb/connections.py:259: OperationalError
---------------------------------------------------------------------------------------------- Captured stdout call -----------------------------------------------------------------------------------------------
Index('ix_test_table_0a574', Column('signal_type', INTEGER(display_width=11), table=&lt;test_table&gt;, nullable=False), Column('signal_data', MEDIUMTEXT(collation='utf8_czech_ci'), table=&lt;test_table&gt;, nullable=False))

</code></pre></div>
<h3 dir="auto">Versions</h3>
<ul dir="auto">
<li>OS: Linux - Manjaro</li>
<li>Python: 3.9.15</li>
<li>SQLAlchemy: 1.3.24</li>
<li>Database: MariaDB</li>
<li>DBAPI (eg: psycopg, cx_oracle, mysqlclient):</li>
</ul>
<h3 dir="auto">Additional context</h3>
<p dir="auto">The reason why we first create the backup_table without indices is that we migrate selected data first avoiding the cost of indexing on each write and add the index at the end which is significantly faster.</p>