yzeng1618 commented on PR #11109:
URL: https://github.com/apache/seatunnel/pull/11109#issuecomment-4738447270
Thanks @SEZ9 for the careful review and the concrete suggestions! All of
these are addressed in the latest head `ab80b9e` ("Harden CLI transform
metadata constraints"). A point-by-point rundown:
**1. Test Coverage Enhancements**
- *Fault tolerance:* `_value_constraint_to_dict()` already guards the
condition tree (`tree = constraint.get("conditionTree") or {}` plus an
`isinstance(tree, dict)` check), so a malformed/missing tree degrades
gracefully to just the `expression`. I've now added a dedicated edge-case test,
`test_value_constraint_tolerates_missing_or_malformed_condition_tree`, covering
a missing tree, a `None` tree, and a non-dict tree. For unexpected
`expectValue` types I added `_constraint_value_to_text()`: strings pass
through, structured values are serialized via `json.dumps`, and anything
non-serializable falls back to `str()`. This is covered by
`test_value_constraint_formats_complex_expect_value_as_json` (a list value
renders as `["batch", "streaming"]`), with no unhandled exceptions on any
branch.
- *Operator formatting:* Good catch. `_format_value_constraint()` now
special-cases the `extension` operator, so it renders `- `query` must not be
blank` instead of the awkward `- `query` extension must not be blank`. The
prompt test asserts the natural phrasing and explicitly `assertNotIn`s the old
one, so the LLM only ever sees the clean wording.
**2. Documentation Updates**
- Updated both `seatunnel-cli/README.md` and
`seatunnel-cli/README.zh-CN.md`: a new "Transform Metadata" entry under
Features, a clarified Architecture/bundled-metadata section stating that
source, sink, and transform plugins all carry full option rules and value
constraints, and an updated `/connectors` row.
- Added a note to the interactive `/connectors` output in `cli.py`:
"Transform option rules and value constraints are supported during generation."
Happy to tweak the constraint phrasing further if you'd prefer different
wording. Thanks again!
--
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]