You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] French translation causes KeyError('statement_num') in SQL Lab - all queries fail (v6.0.0) #39566
All SQL Lab queries fail with SupersetErrorsException: 'statement_num' when Superset is configured with the French locale (BABEL_DEFAULT_LOCALE = "fr"). This includes even SELECT 1.
This was already reported in #27367 but the issue was closed. The bug is still present in version 6.0.0.
Root cause
The string "Running block %(block_num)s out of %(block_count)s" in sql_lab.py is translated in translations/fr/LC_MESSAGES/messages.json as:
"Exécution de l'instruction %(statement_num)s sur %(statement_count)s"
The variables %(block_num)s and %(block_count)s are replaced by %(statement_num)s and %(statement_count)s, which do not exist in the format call, causing a KeyError('statement_num') that propagates as a SupersetErrorsException and makes every SQL Lab query fail.
Steps to reproduce
Deploy Superset 6.0.0
Set BABEL_DEFAULT_LOCALE = "fr" in superset_config.py
Open SQL Lab and run any query, including SELECT 1
This bug is confirmed and was previously reported in #38468. The root cause is PR #33542, which renamed variables from statement_num/statement_count to block_num/block_count in sql_lab.py but didn't update the translation files [1].
The French .po file still has the old variable names in the msgstr:
msgid"Running block %(block_num)s out of %(block_count)s"msgstr"Exécution de l'instruction %(statement_num)s sur %(statement_count)s"
Worth noting: this isn't just a French issue — at least 10 other languages (Slovenian, Russian, Dutch, Polish, Japanese, Portuguese, German, Arabic, Ukrainian, and Persian) have the same stale variable names and will hit the same KeyError[2].
Your suggested fix is correct. The msgstr for all affected languages needs to use %(block_num)s and %(block_count)s, and the .mo files need to be recompiled.
I think since the fix landed, we can consider the issue closed, but if someone wants to wait for the next patch release and close it then, I'm OK with that. We just usually close first, release later, to keep the backlog as lean as possible.
We just usually close first, release later, to keep the backlog as lean as possible.
I started off disagreeing but have come around to this opinion too. It's too confusing, I just got tripped up by this issue being marked as open when in fact the fix is already merged. If 6.0.1 is still being worked on, that PR should get cherried for that.
Activity
dosubot commentedon Apr 22, 2026
This bug is confirmed and was previously reported in #38468. The root cause is PR #33542, which renamed variables from
statement_num/statement_counttoblock_num/block_countinsql_lab.pybut didn't update the translation files [1].The French
.pofile still has the old variable names in themsgstr:Worth noting: this isn't just a French issue — at least 10 other languages (Slovenian, Russian, Dutch, Polish, Japanese, Portuguese, German, Arabic, Ukrainian, and Persian) have the same stale variable names and will hit the same
KeyError[2].Your suggested fix is correct. The
msgstrfor all affected languages needs to use%(block_num)sand%(block_count)s, and the.mofiles need to be recompiled.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
hainenber commentedon Apr 23, 2026
This is fixed by #38494 but this isn't landed in v6 yet, only at
masterbranch.rusackas commentedon May 11, 2026
I think since the fix landed, we can consider the issue closed, but if someone wants to wait for the next patch release and close it then, I'm OK with that. We just usually close first, release later, to keep the backlog as lean as possible.
sfirke commentedon May 15, 2026
I started off disagreeing but have come around to this opinion too. It's too confusing, I just got tripped up by this issue being marked as open when in fact the fix is already merged. If 6.0.1 is still being worked on, that PR should get cherried for that.