Skip to content

[bug] French translation causes KeyError('statement_num') in SQL Lab - all queries fail (v6.0.0) #39566

Closed

Description

@vit-opti

Bug description

Bug description

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

  1. Deploy Superset 6.0.0
  2. Set BABEL_DEFAULT_LOCALE = "fr" in superset_config.py
  3. Open SQL Lab and run any query, including SELECT 1
  4. Query fails with 'statement_num'

Expected behavior

Queries execute normally.

Actual behavior

superset.exceptions.SupersetErrorsException: [SupersetError(message="'statement_num'", ...)]

Workaround

Add BABEL_DEFAULT_LOCALE = "en" in superset_config.py.

Fix

Correct the French translation in translations/fr/LC_MESSAGES/messages.json:

"Running block %(block_num)s out of %(block_count)s": [
  "Exécution du bloc %(block_num)s sur %(block_count)s"
]

Superset version

6.0.0

Python version

3.12

Screenshots/recordings

No response

Superset version

6.0.0

Python version

3.11

Node version

16

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Activity

  1. dosubot commented on Apr 22, 2026

    @dosubot

    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.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about superset with Dosu Add Dosu to your team

  2. added
    i18n:frenchTranslation related to French language
    sqllabNamespace | Anything related to the SQL Lab
    on Apr 22, 2026
  3. hainenber commented on Apr 23, 2026

    @hainenber
    Contributor

    This is fixed by #38494 but this isn't landed in v6 yet, only at master branch.

  4. rusackas commented on May 11, 2026

    @rusackas
    Member

    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.

  5. sfirke commented on May 15, 2026

    @sfirke
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    i18n:frenchTranslation related to French languagesqllabNamespace | Anything related to the SQL Labvalidation:requiredA committer should validate the issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions