<p dir="auto">select * from table;</p>
<p dir="auto">that query (with semicolon) runs fine in SQLLab but after clicking Explore on the results the Chart page gives an error about semicolon not allowed</p>
<p dir="auto">When running the command <code class="notranslate">superset db upgrade</code>, I am receiving the following error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Traceback (most recent call last):
  File &quot;/usr/local/bin/superset&quot;, line 33, in &lt;module&gt;
    sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 829, in __call__
    return self.main(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/cli.py&quot;, line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 782, in main
    rv = self.invoke(ctx)
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 610, in invoke
    return callback(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/click/decorators.py&quot;, line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/flask/cli.py&quot;, line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/click/core.py&quot;, line 610, in invoke
    return callback(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_migrate/cli.py&quot;, line 134, in upgrade
    _upgrade(directory, revision, sql, tag, x_arg)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_migrate/__init__.py&quot;, line 96, in wrapped
    f(*args, **kwargs)
  File &quot;/usr/local/lib/python3.7/site-packages/flask_migrate/__init__.py&quot;, line 271, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/command.py&quot;, line 298, in upgrade
    script.run_env()
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/script/base.py&quot;, line 489, in run_env
    util.load_python_file(self.dir, &quot;env.py&quot;)
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py&quot;, line 98, in load_python_file
    module = load_module_py(module_id, path)
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/util/compat.py&quot;, line 184, in load_module_py
    spec.loader.exec_module(module)
  File &quot;&lt;frozen importlib._bootstrap_external&gt;&quot;, line 728, in exec_module
  File &quot;&lt;frozen importlib._bootstrap&gt;&quot;, line 219, in _call_with_frames_removed
  File &quot;/app/superset/migrations/env.py&quot;, line 124, in &lt;module&gt;
    run_migrations_online()
  File &quot;/app/superset/migrations/env.py&quot;, line 116, in run_migrations_online
    context.run_migrations()
  File &quot;&lt;string&gt;&quot;, line 8, in run_migrations
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/runtime/environment.py&quot;, line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/runtime/migration.py&quot;, line 522, in run_migrations
    step.migration_fn(**kw)
  File &quot;/app/superset/migrations/versions/b6fa807eac07_make_names_non_nullable.py&quot;, line 70, in upgrade
    &quot;table_name&quot;, existing_type=sa.String(250), nullable=False
  File &quot;/usr/local/lib/python3.7/contextlib.py&quot;, line 119, in __exit__
    next(self.gen)
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/operations/base.py&quot;, line 353, in batch_alter_table
    impl.flush()
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/operations/batch.py&quot;, line 82, in flush
    fn(*arg, **kw)
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/ddl/postgresql.py&quot;, line 147, in alter_column
    **kw
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/ddl/impl.py&quot;, line 179, in alter_column
    existing_comment=existing_comment,
  File &quot;/usr/local/lib/python3.7/site-packages/alembic/ddl/impl.py&quot;, line 141, in _exec
    return conn.execute(construct, *multiparams, **params)
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1011, in execute
    return meth(self, multiparams, params)
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py&quot;, line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1073, in _execute_ddl
    compiled,
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1317, in _execute_context
    e, statement, parameters, cursor, context
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1511, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py&quot;, line 182, in raise_
    raise exception
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py&quot;, line 1277, in _execute_context
    cursor, statement, parameters, context
  File &quot;/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py&quot;, line 593, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) column &quot;table_name&quot; contains null values

[SQL: ALTER TABLE tables ALTER COLUMN table_name SET NOT NULL]
(Background on this error at: http://sqlalche.me/e/13/gkpj)"><pre class="notranslate"><code class="notranslate">Traceback (most recent call last):
  File "/usr/local/bin/superset", line 33, in &lt;module&gt;
    sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 586, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 426, in decorator
    return __ctx.invoke(f, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask_migrate/cli.py", line 134, in upgrade
    _upgrade(directory, revision, sql, tag, x_arg)
  File "/usr/local/lib/python3.7/site-packages/flask_migrate/__init__.py", line 96, in wrapped
    f(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask_migrate/__init__.py", line 271, in upgrade
    command.upgrade(config, revision, sql=sql, tag=tag)
  File "/usr/local/lib/python3.7/site-packages/alembic/command.py", line 298, in upgrade
    script.run_env()
  File "/usr/local/lib/python3.7/site-packages/alembic/script/base.py", line 489, in run_env
    util.load_python_file(self.dir, "env.py")
  File "/usr/local/lib/python3.7/site-packages/alembic/util/pyfiles.py", line 98, in load_python_file
    module = load_module_py(module_id, path)
  File "/usr/local/lib/python3.7/site-packages/alembic/util/compat.py", line 184, in load_module_py
    spec.loader.exec_module(module)
  File "&lt;frozen importlib._bootstrap_external&gt;", line 728, in exec_module
  File "&lt;frozen importlib._bootstrap&gt;", line 219, in _call_with_frames_removed
  File "/app/superset/migrations/env.py", line 124, in &lt;module&gt;
    run_migrations_online()
  File "/app/superset/migrations/env.py", line 116, in run_migrations_online
    context.run_migrations()
  File "&lt;string&gt;", line 8, in run_migrations
  File "/usr/local/lib/python3.7/site-packages/alembic/runtime/environment.py", line 846, in run_migrations
    self.get_context().run_migrations(**kw)
  File "/usr/local/lib/python3.7/site-packages/alembic/runtime/migration.py", line 522, in run_migrations
    step.migration_fn(**kw)
  File "/app/superset/migrations/versions/b6fa807eac07_make_names_non_nullable.py", line 70, in upgrade
    "table_name", existing_type=sa.String(250), nullable=False
  File "/usr/local/lib/python3.7/contextlib.py", line 119, in __exit__
    next(self.gen)
  File "/usr/local/lib/python3.7/site-packages/alembic/operations/base.py", line 353, in batch_alter_table
    impl.flush()
  File "/usr/local/lib/python3.7/site-packages/alembic/operations/batch.py", line 82, in flush
    fn(*arg, **kw)
  File "/usr/local/lib/python3.7/site-packages/alembic/ddl/postgresql.py", line 147, in alter_column
    **kw
  File "/usr/local/lib/python3.7/site-packages/alembic/ddl/impl.py", line 179, in alter_column
    existing_comment=existing_comment,
  File "/usr/local/lib/python3.7/site-packages/alembic/ddl/impl.py", line 141, in _exec
    return conn.execute(construct, *multiparams, **params)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1011, in execute
    return meth(self, multiparams, params)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/ddl.py", line 72, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1073, in _execute_ddl
    compiled,
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1317, in _execute_context
    e, statement, parameters, cursor, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1511, in _handle_dbapi_exception
    sqlalchemy_exception, with_traceback=exc_info[2], from_=e
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py", line 182, in raise_
    raise exception
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1277, in _execute_context
    cursor, statement, parameters, context
  File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 593, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.IntegrityError: (psycopg2.errors.NotNullViolation) column "table_name" contains null values

[SQL: ALTER TABLE tables ALTER COLUMN table_name SET NOT NULL]
(Background on this error at: http://sqlalche.me/e/13/gkpj)
</code></pre></div>
<p dir="auto">Which prevents the completion of the database upgrade.</p>
<h3 dir="auto">Expected results</h3>
<p dir="auto">DB Upgrade completes.</p>
<h3 dir="auto">Actual results</h3>
<p dir="auto">Reference stacktrace above.</p>
<h4 dir="auto">How to reproduce the bug</h4>
<p dir="auto">Run <code class="notranslate">superset db upgrade</code> on older database.</p>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>superset version: v1.1 (upgrading from v0.34.1rc1)</li>
<li>python version: <code class="notranslate">3.8</code></li>
<li>node.js version: <code class="notranslate">v16.1.0</code></li>
<li>any feature flags active: N/A</li>
</ul>
<h3 dir="auto">Checklist</h3>
<p dir="auto">Make sure to follow these steps before submitting your issue - thank you!</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the superset logs for python stacktraces and included it here as text if there are any.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have reproduced the issue with at least the latest released version of superset.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the issue tracker for the same issue and I haven't found one similar.</li>
</ul>
<p dir="auto">Duplicate Issue: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="813406216" data-permission-text="Title is private" data-url="https://github.com/apache/superset/issues/13272" data-hovercard-type="issue" data-hovercard-url="/apache/superset/issues/13272/hovercard" href="https://github.com/apache/superset/issues/13272">#13272</a></p>
<p dir="auto">Posting this as issue, as the former has not yet been addressed.</p>
<h3 dir="auto">Additional context</h3>
<p dir="auto">Solution: Access DB that is to be upgraded, navigate to "tables" table, input value for row that contains null-valued column "table_name" so that it is no longer null.</p>