apache / apache/texera

Filled Area Plot accepts a Split-Plot configuration it then refuses to run

Open
#8,283 0 comments 0 reactions 1 assignee Claimed by @kz930 View on GitHub
Dominant language
Scala
Stars
314
Forks
187
Avg merge
1d 21h
Merged PRs (30d)
214

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.