SEZ9 opened a new issue, #13415:
URL: https://github.com/apache/seatunnel/issues/13415

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Bug%22)
 and found no similar issues. No open PR changes `_transform_connector_name`.
   
   ### What happened
   
   When a plan carries more than one transform, `seatunnel-cli` uses the whole 
list as a connector name and the metadata lookup can never succeed.
   
   `seatunnel_cli/skills.py`:
   
   ```python
   def _transform_connector_name(transform: object) -> str:
       """Return the transform plugin name from a structured or string plan 
field."""
       if not transform:
           return ""
       if isinstance(transform, dict):
           for key in ("connector", "name", "type"):
               value = transform.get(key)
               if value:
                   return str(value)
           return ""
       return str(transform)          # <-- a list lands here
   ```
   
   A `dict` is handled, a plain string is handled, but a `list` falls through 
to `str(transform)`. The result is passed straight to 
`fetch_connector_metadata()` by `_metadata_targets_for_pipeline()`, which logs 
and gives up (`seatunnel_cli/connectors.py`):
   
   ```python
   logger.warning(f"No metadata found for {plugin_type}:{plugin_name}")
   ```
   
   Reproduced directly against the current function on `dev`:
   
   | plan field | returned name |
   | --- | --- |
   | `"Sql"` | `Sql` |
   | `{"connector": "Sql", ...}` | `Sql` |
   | `["Sql", "FieldMapper"]` | `['Sql', 'FieldMapper']` |
   | `[{"connector": "Sql"}, {"connector": "FieldMapper"}]` | `[{'connector': 
'Sql'}, {'connector': 'FieldMapper'}]` |
   
   ### What you expected to happen
   
   Every transform in the pipeline contributes its own metadata target, so the 
generator receives the real option rules for each one.
   
   Today the whole multi-transform pipeline silently gets **no** transform 
option rules at all, and the generator has to invent option keys for transforms 
it was given no metadata for.
   
   ### SeaTunnel Version
   
   dev (`a76348f1f9`)
   
   ### SeaTunnel Config
   
   ```conf
   Not a job config problem: this is in the CLI's plan-to-metadata path.
   ```
   
   ### Running Command
   
   ```shell
   # Any request whose plan resolves to more than one transform, e.g.
   sh bin/seatunnel-ai.sh "read orders from MySQL, keep amount > 100, rename 
amount to total, write to Console"
   ```
   
   ### Error Exception
   
   ```log
   No metadata found for transform:['Sql', 'FieldMapper']
   ```
   
   ### Zeta or Flink or Spark Version
   
   Not engine specific.
   
   ### Java or Scala Version
   
   Not applicable (Python CLI).
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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]

Reply via email to