Skip to content
Permalink
Browse files
Simplify flash message for _airflow_moved tables (#23635)
Co-authored-by: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com>
  • Loading branch information
dstandish and jedcunningham committed May 11, 2022
1 parent 4acb2c6 commit b68667843c7a9796e7017b729f4474c0b0c990cd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
@@ -80,15 +80,27 @@
{% for m in dashboard_alerts %}
{{ show_message(m.message, m.category) }}
{% endfor %}
{% for original_table_name, moved_table_name in migration_moved_data_alerts %}
{% call show_message(category='error', dismissible=false) %}
Airflow found incompatible data in the <code>{{ original_table_name }}</code> table in the
metadatabase, and has moved them to <code>{{ moved_table_name }}</code> during the database migration
to upgrade. Please inspect the moved data to decide whether you need to keep them, and manually drop
the <code>{{ moved_table_name }}</code> table to dismiss this warning. Read more about it
{% if migration_moved_data_alerts %}
{% call show_message(category='warning', dismissible=false) %}
While upgrading the metadatabase, Airflow had to move some bad data in order to apply new constraints.
The moved data can be found in the following tables:<br>
<table>
<tr>
<th style="padding-right:10px">Source table</th>
<th>Table with moved rows</th>
</tr>
{% for original_table_name, moved_table_name in migration_moved_data_alerts %}
<tr>
<td style="padding-right:10px"><code>{{ original_table_name }}</code></td>
<td><code>{{ moved_table_name }}</code></td>
</tr>
{% endfor %}
</table>
Please inspect the moved data to decide whether you need to keep them, and manually drop
the moved tables to dismiss this warning. Read more about it
in <a href={{ get_docs_url("installation/upgrading.html") }}><b>Upgrading</b></a>.
{% endcall %}
{% endfor %}
{% endif %}
{{ super() }}
{% if sqlite_warning | default(true) %}
{% call show_message(category='warning', dismissible=false) %}
@@ -831,13 +831,13 @@ def index(self):

def _iter_parsed_moved_data_table_names():
for table_name in inspect(session.get_bind()).get_table_names():
segments = table_name.split("__", 2)
segments = table_name.split("__", 3)
if len(segments) < 3:
continue
if segments[0] != settings.AIRFLOW_MOVED_TABLE_PREFIX:
continue
# Second segment is a version marker that we don't need to show.
yield segments[2], table_name
yield segments[3], table_name

if (
permissions.ACTION_CAN_ACCESS_MENU,

0 comments on commit b686678

Please sign in to comment.