kz930 opened a new issue, #8283:
URL: https://github.com/apache/texera/issues/8283

   ### What happened?
   
   `Split Plot by Line Group` is a boolean, and turning it on makes `Line 
Group` required, because code generation asserts it:
   
   ```scala
   if (facetColumn) {
     assert(lineGroup.nonEmpty, "Line Group cannot be empty")
   }
   ```
   
   But `Line Group` is declared `@JsonProperty(required = false)` and carries 
no conditional constraint, so the property panel accepts the configuration. The 
error arrives only when the user hits run and the operator generates its code, 
and `Line Group` being optional is exactly why it is easy to leave behind.
   
   I expected the panel to refuse the configuration while it is being written, 
the way the Sklearn operators' `Text Attribute` is refused when `Count 
Vectorizer` is on (#7643). That one states the rule as a conditional required 
in the schema:
   
   ```
   "allOf": [{ "if":   { "properties": { "countVectorizer": { "const": true } } 
},
               "then": { "required": ["text"] } }]
   ```
   
   The same shape applies here: `required: ["lineGroup"]` when `facetColumn` is 
true. Conditional rather than a plain required, so a freshly dropped operator, 
whose switch is off, is not flagged for a field it has no use for.
   
   ### How to reproduce?
   
   1. Drop a Filled Area Plot and give it an X and a Y attribute.
   2. Turn on `Split Plot by Line Group`.
   3. Leave `Line Group` empty.
   4. Run.
   
   The run ends with the assertion below. The panel shows nothing wrong before 
that.
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   
   ### Relevant log output
   
   ```shell
   java.lang.AssertionError: assertion failed: Line Group cannot be empty
   ```
   


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