Skip to content

fix(i18n): parameterize the missing annotation chart error message - #44548

Closed
villebro wants to merge 1 commit into
apache:masterfrom
villebro:villebro/fix-annotation-gettext-fstring
Closed

villebro wants to merge 1 commit into
apache:masterfrom
villebro:villebro/fix-annotation-gettext-fstring

Conversation

@villebro

Copy link
Copy Markdown
Member

SUMMARY

The "chart referenced by annotation layer was not found" error in superset/common/query_context_processor.py was an f-string inside gettext, so it has never been translatable. It also breaks the pot drift check added in #44467 on the Python 3.12 unit-test job: with 3.12's f-string tokenization (PEP 701), Babel picks up the literal "value" and "name" dict keys inside the f-string's replacement fields and extracts them as a bogus msgid valuename. Python 3.11 skips the f-string, so only the next job fails.

This changes the call to a normal parameterized gettext message and regenerates the catalogs with scripts/translations/babel_update.sh. The regeneration also picks up the reworded connection-move message from #44036, which merged without a catalog update and makes check_pot_drift fail on 3.11 as well.

TESTING INSTRUCTIONS

  • python scripts/translations/check_pot_drift.py passes under Python 3.11.
  • The same passes under 3.12, e.g. uv run --no-project --python 3.12 --with babel==2.17.0 --with jinja2==3.1.6 -- python scripts/translations/check_pot_drift.py. Before this change it reports valuename as missing.
  • pytest tests/unit_tests/common/ tests/unit_tests/scripts/translations/

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

The same fix is already on the 7.0 release branch.

The message was an f-string inside gettext, so it was never translatable.
Under Python 3.12, Babel also extracts the f-string's inner "value" and "name"
literals as a bogus msgid "valuename", which fails check_pot_drift in the 3.12
unit-test job. Also regenerates the catalogs, which were missing apache#44036's
reworded connection-move message.
@bito-code-review

bito-code-review Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Bito Review Skipped - Source Branch Not Found

Bito didn’t review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

@github-actions github-actions Bot added i18n Namespace | Anything related to localization i18n:spanish Translation related to Spanish language i18n:italian Translation related to Italian language i18n:french Translation related to French language i18n:chinese Translation related to Chinese language i18n:japanese Translation related to Japanese language i18n:russian Translation related to Russian language i18n:korean Translation related to Korean language i18n:dutch i18n:slovak i18n:ukrainian i18n:portuguese i18n:brazilian i18n:traditional-chinese i18n:persian i18n:czech i18n:latvian labels Sep 23, 2026
@villebro villebro closed this Sep 23, 2026
@villebro
villebro deleted the villebro/fix-annotation-gettext-fstring branch September 23, 2026 00:24
@codecov

codecov Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.91%. Comparing base (350dd0d) to head (feac89a).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master   #44548       +/-   ##
===========================================
+ Coverage   66.20%   80.91%   +14.71%     
===========================================
  Files        2948     2948               
  Lines      177295   177293        -2     
  Branches    41089    41087        -2     
===========================================
+ Hits       117376   143465    +26089     
+ Misses      57416    31122    -26294     
- Partials     2503     2706      +203     
Flag Coverage Δ
hive 36.92% <ø> (ø)
mysql 56.16% <ø> (-0.01%) ⬇️
postgres 56.17% <ø> (ø)
presto 38.86% <ø> (ø)
python 85.21% <ø> (+28.72%) ⬆️
sqlite 55.88% <ø> (ø)
unit 77.44% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

i18n:brazilian i18n:chinese Translation related to Chinese language i18n:czech i18n:dutch i18n:french Translation related to French language i18n:italian Translation related to Italian language i18n:japanese Translation related to Japanese language i18n:korean Translation related to Korean language i18n:latvian i18n:persian i18n:portuguese i18n:russian Translation related to Russian language i18n:slovak i18n:spanish Translation related to Spanish language i18n:traditional-chinese i18n:ukrainian i18n Namespace | Anything related to localization size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant