rusackas commented on PR #39448: URL: https://github.com/apache/superset/pull/39448#issuecomment-4426131825
Thanks @sadpandajoe — addressed all four in 795d6e67df. 1. **Tests added** — `tests/unit_tests/scripts/translations/backfill_po_test.py` (19 cases) covers `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, 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. **Stdin instead of argv** — `translate_batch` now uses `subprocess.run([claude_bin, '--model', model, '-p'], input=prompt, ...)`. Removes the ARG_MAX ceiling for batches with many reference languages. 3. **Save after each batch** — `_process_batches` now calls `cat.save()` after each batch that wrote at least one translation (when not in `--dry-run`). The single end-of-run `cat.save()` in `backfill()` is removed since the per-batch save covers it. A crash mid-run now only loses the in-flight batch. 4. **Docstring fixed** — module docstring's `--fuzzy/--no-fuzzy` line now reads `--no-fuzzy Do not mark generated translations as fuzzy (default: mark fuzzy)` to match what argparse actually registers. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
