Commit Graph

162 Commits

Author SHA1 Message Date
Evan Rusackas
6d2bf6b10c Merge branch 'master' into feat/translation-backfill-tooling 2026-05-11 19:55:42 -07:00
Superset Dev
fe3fa946c4 fix(i18n): handle JSON-list plural responses from the model
A fresh test run on French exposed a real bug in _apply_translation:
when the model returns a JSON list for a plural entry (e.g.
["form0", "form1"], which is a valid representation since plural forms
are ordered), the previous code took the else branch and broadcast
str(list) — Python list-repr like ['form0', 'form1'] — to every plural
form. Both msgstr[0] and msgstr[1] ended up containing the same
literal Python list-repr string, breaking gettext lookups for that
entry. Spanish dodged it by chance (the model returned dicts that
time); the failure mode is reproducible on French.

Changes:
- Extract _apply_plural_translation helper. Handles dict, list,
  scalar, and non-JSON-string responses. List path distributes forms
  by index and repeats the last form if the model returned fewer
  forms than the language requires (better than leaving slots blank,
  which falls back to displaying the raw English msgid).
- The split also drops _apply_translation's cyclomatic complexity
  back below the C901 threshold.
- Adds 4 regression tests covering: list response, list response
  round-tripped through parse_response, list shorter than required
  forms (last-form-repeats), and empty list (falls back to raw-string
  broadcast).

Verified end-to-end on French: the previously-broken plural entry
"Added 1 new column to the virtual dataset" / "Added %s new columns
to the virtual dataset" now writes msgstr[0] and msgstr[1] correctly
on a fresh run.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 17:47:24 -07:00
Superset Dev
795d6e67df test(i18n): cover backfill_po + address review feedback
Addresses sadpandajoe's review on #39448:

1. Adds tests/unit_tests/scripts/translations/backfill_po_test.py with
   19 cases covering parse_response (singular/plural/markdown-fence
   stripping/non-ASCII/non-numeric keys/list-and-scalar rejection/JSON
   errors) and _apply_translation (singular path, plural-dict path,
   plural-scalar fallback, plural invalid-JSON fallback, fuzzy flag,
   attribution append/dedup, end-to-end round-trip from parse_response
   into _apply_translation). The script is loaded via importlib since
   it lives outside the package tree.

2. translate_batch now pipes the prompt over stdin instead of passing
   it as argv. With --batch-size 50 and many reference languages a
   single batch can grow into the tens of KB and approach ARG_MAX on
   some platforms; stdin removes that ceiling.

3. _process_batches now saves the catalog after each batch that wrote
   at least one translation (when not in --dry-run). For sparse
   languages with thousands of missing strings, a crash mid-run now
   only loses the in-flight batch rather than every batch translated
   so far. The full save at end of backfill() is removed since the
   per-batch save covers it.

4. Module docstring referenced --fuzzy/--no-fuzzy but argparse only
   registers --no-fuzzy; doc updated to match the actual flag.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-11 16:59:40 -07:00
Michael S. Molina
6ce3885f2e chore(build): remove thread-loader from webpack build (#39763) 2026-04-29 15:04:34 -03:00
Claude Code
73a042ed5c fix(i18n): validate parse_response JSON is a dict before .items()
A non-object JSON response (list, scalar, null) would raise AttributeError
from .items(). _process_batches only catches (ValueError, RuntimeError),
so the crash would abort the entire run instead of being handled per-batch.
Surface the type error as ValueError so it's caught gracefully.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-20 08:52:54 -07:00
Claude Code
1ac81f7a31 docs(i18n): add docstrings to backfill() and main()
Addresses two codeant-ai review comments about missing docstrings on
newly added top-level functions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 16:14:04 -07:00
Claude Code
37af05c292 fix(i18n): restore clobbered code, fix plural coercion & fuzzy-as-context
Four "Apply suggestion" commits from codeant-ai replaced real code bodies
with docstring-only lines, breaking syntax (syntax errors at
build_translation_index.py:119). Restore the bodies while keeping the
suggested docstrings:

- build_translation_index.py: _plural_key, main()
- backfill_po.py: _lang_name, _plural_key

Also addresses two major issues raised in review:

1. parse_response() in backfill_po.py used str(v) on values, which
   converted dict responses (from plural entries) into Python repr
   like "{'0': 'x'}" that json.loads could not later parse in
   _apply_translation. Serialize dict/list values with json.dumps.

2. build_index() wrote fuzzy entries as trusted context in the
   cross-language index, letting AI-generated drafts propagate back
   into future backfill runs as if reviewed. Gate index values via
   _is_translated so fuzzy entries become null.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-04-18 16:12:08 -07:00
Evan Rusackas
88c7389ee5 Apply suggestion from @codeant-ai-for-open-source[bot]
Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
2026-04-17 18:18:10 -07:00
Evan Rusackas
ee6779c84a Apply suggestion from @codeant-ai-for-open-source[bot]
Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
2026-04-17 18:17:53 -07:00
Evan Rusackas
7bc0e385b8 Apply suggestion from @codeant-ai-for-open-source[bot]
Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
2026-04-17 18:17:42 -07:00
Evan Rusackas
f684eccd94 Apply suggestion from @codeant-ai-for-open-source[bot]
Co-authored-by: codeant-ai-for-open-source[bot] <244253245+codeant-ai-for-open-source[bot]@users.noreply.github.com>
2026-04-17 18:17:12 -07:00
Claude Code
0a91bce9ea feat(i18n): add AI-assisted translation backfill tooling + Spanish translations
Adds two scripts to help maintainers fill in missing .po translations
using Claude AI, and applies them to backfill all 184 missing Spanish strings.

New scripts:
- scripts/translations/build_translation_index.py — reads every .po file
  and outputs a cross-language JSON index {msgid: {lang: translation}}
  used to provide reference context to the AI
- scripts/translations/backfill_po.py — for a target language, finds all
  untranslated entries, batches them, and calls claude -p with cross-language
  context to generate draft translations marked #, fuzzy for human review

Design highlights:
- Cross-language translations are passed per-string so the AI can disambiguate
  ambiguous English (e.g. "Scale", "Table") from how other translators handled it
- --min-context N skips strings with fewer than N reference translations
- Each generated entry is tagged with a translator comment listing the model
  and which languages provided context (e.g. [refs: fr, ru])
- translation_index.json added to .gitignore (regenerated locally)

Spanish translations:
- Backfilled all 184 previously untranslated strings in es/LC_MESSAGES/messages.po
- All entries marked #, fuzzy pending human review

Docs: added "Backfilling missing translations with AI" section to
docs/developer_docs/contributing/howtos.md

npm shortcuts added to superset-frontend/package.json:
- translations:build-index
- translations:backfill

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-17 10:04:22 -07:00
Michael S. Molina
6cb3cea960 feat(extensions): Allow replacing editors using extensions (#37499) 2026-01-29 08:22:32 -03:00
Evan Rusackas
d2907b2577 docs: federate scattered markdown files into centralized docs (#36756)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 13:00:54 -08:00
Evan Rusackas
dee063a4c5 feat(examples): Modernize example data loading with Parquet and YAML configs (#36538)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-21 12:42:15 -08:00
Evan Rusackas
1949d1bb96 feat(dev): add make ports and make open commands (#36906)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 10:52:00 -08:00
Evan Rusackas
91539f77aa feat(docker): support running multiple Superset instances simultaneously (#36751)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-18 17:04:58 -08:00
Joe Li
979d385eea fix: recompile dependencies with linux and update generate dependency script (#36194) 2025-11-20 13:42:42 -05:00
Evan Rusackas
8ccdf3b32b feat(frontend): Replace ESLint with OXC hybrid linting architecture (#35506)
Co-authored-by: Claude <noreply@anthropic.com>
2025-10-30 09:26:21 -07:00
Michael S. Molina
bcf156c969 fix: Rename apache-superset-cli to apache-superset-extensions-cli (#34883) 2025-08-28 14:40:09 -03:00
Michael S. Molina
a8be5a5a0c chore: Extensions architecture POC (#31934)
Co-authored-by: Ville Brofeldt <ville.brofeldt@apple.com>
Co-authored-by: Ville Brofeldt <ville@Villes-MacBook-Pro-2024.local>
Co-authored-by: Ville Brofeldt <v_brofeldt@apple.com>
2025-08-22 21:25:52 -03:00
Maxime Beauchemin
cb27d5fe8d chore: proper current_app.config proxy usage (#34345)
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-31 19:27:42 -07:00
Maxime Beauchemin
9099b0f00d fix: fix the pre-commit hook for tsc (#34275)
Co-authored-by: Mehmet Salih Yavuz <salih.yavuz@proton.me>
2025-07-23 13:21:54 -07:00
Maxime Beauchemin
73dfe57ae2 fix: make flask-cors a core dependency (#34115) 2025-07-09 14:54:39 -07:00
Đỗ Trọng Hải
f6f9582186 fix(docs|build): revert docker-compose files rename (#33883) 2025-06-24 22:49:58 +07:00
Vladislav Polyakov
a23a4ed054 refactor: rename docker-compose files and update references (#33790)
Signed-off-by: Vladislav Polyakov <polRk@ydb.tech>
2025-06-20 12:00:34 -07:00
Maxime Beauchemin
05faf2f352 fix: resolve recent merge collisio (#33110) 2025-04-12 16:33:00 -07:00
Maxime Beauchemin
ac4df8d06b fix: CI file change detector to handle large PRs (#33092) 2025-04-12 12:08:41 -07:00
Maxime Beauchemin
664047f3fb chore: fix precommit for eslint (#32596) 2025-03-12 11:26:36 -07:00
Evan Rusackas
90651dfe3e fix(dev/ci): pre-commit fixes galore (#32352) 2025-02-24 11:26:45 -07:00
alveifbklsiu259
c583eec4c7 fix(eslint-hook): ensure eslint hook receives arguments (#32333) 2025-02-24 08:57:48 -08:00
alveifbklsiu259
e422e3c620 feat(type-checking): Add type-checking pre-commit hooks (#32261) 2025-02-19 15:12:17 -08:00
Maxime Beauchemin
568f6d958b fix: Revert "fix: re-enable cypress checks" (#32045) 2025-01-30 14:20:55 -03:00
Maxime Beauchemin
b12f515185 fix: re-enable cypress checks (#32008) 2025-01-29 23:29:30 -08:00
Maxime Beauchemin
dfb9af36df chore: cypress set up tweaks (#31926) 2025-01-21 12:06:19 -08:00
Maxime Beauchemin
840773e626 feat: get docker-compose to work as the backend for Cypress tests (#31796) 2025-01-17 16:19:39 -08:00
Maxime Beauchemin
ee36cf058c fix: docker-compose-image-tag fails to start (#31606) 2025-01-06 11:21:58 -08:00
Maxime Beauchemin
e51b95ffa8 chore: enforce more ruff rules (#31447)
Co-authored-by: Elizabeth Thompson <eschutho@gmail.com>
2024-12-18 17:41:34 -08:00
Maxime Beauchemin
9da65d6bfd chore: deprecate pip-compile-multi in favor or uv (#31313) 2024-12-18 17:40:58 -08:00
Maxime Beauchemin
fd9d3301f6 chore: deprecate tox in favor of act (#29382) 2024-11-26 13:27:37 -08:00
Maxime Beauchemin
e0deb704f9 feat: make ephemeral env use supersetbot + deprecate build_docker.py (#30870) 2024-11-22 14:19:08 -08:00
Maxime Beauchemin
0af124eaae feat: add a script to check environment software versions (#29609) 2024-11-08 13:17:55 -08:00
Maxime Beauchemin
daa4b1dc65 fix: battling cypress' dashboard feature (#30441) 2024-09-30 10:50:16 -07:00
Maxime Beauchemin
999dca76c1 fix: cypress on master doesn't work because of --parallel flag (#30430) 2024-09-29 20:32:04 -07:00
Maxime Beauchemin
63e17ca546 fix: CI remove cypress command --headed (#30429) 2024-09-30 00:28:39 +02:00
Maxime Beauchemin
a3bfbd0186 chore: alter scripts/cypress_run to run one file per command + retry (#30397)
Co-authored-by: Joe Li <joe@preset.io>
2024-09-28 17:59:04 -06:00
Elizabeth Thompson
43721f1206 chore: split cypress files for less memory (#30354) 2024-09-25 13:50:53 -07:00
Evan Rusackas
4fe3000275 chore(docs): docker instructions use docker compose instead of the deprecated docker-compose (#30030) 2024-08-29 16:42:53 -06:00
Beto Dealmeida
39209c2b40 fix: handle empty catalog when DB supports them (#29840) 2024-08-13 10:08:43 -04:00
Elizabeth Thompson
57e8cd2ba2 fix: pass slack recipients correctly (#29721) 2024-08-02 10:42:40 -07:00