attributeTypeRules is never checked on a property that takes several columns
- Dominant language
- Scala
- Stars
- 314
- Forks
- 187
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 214
Description
### What happened?
An operator property that takes several column names never has its `attributeTypeRules` checked. The rule is declared, the form accepts a column of any type, and nothing warns.
The check lives in the `checkAttributeType` validator that `setFormlyFormBinding` attaches whenever a schema declares `attributeTypeRules`. Its `findAttributeType` helper reads the property's value as a single attribute name and asks the compiling service for that name's type. A property holding a list hands it an array instead, no attribute matches, the type comes back undefined, and the validator treats the property as not yet filled in and moves on. Single-column properties are unaffected, which is why the gap has gone unnoticed.
Four operators on main declare a rule on such a property, so all four rules are inert today: Scatter Matrix Chart's Selected Attributes, Parallel Coordinates Plot's dimensions, Radar Chart's valueColumns, and Radar Plot's selectedAttributes.
There is a second, related gap. The Selected Features property shared by the four sklearn advanced trainers (KNN Classifier, KNN Regressor, SVC, SVR) declares no rule at all. Those columns reach `fit` with no preprocessing, so a text column fails inside scikit-learn with "could not convert string to float". Declaring the rule is only worth doing once the validator reads lists, so both belong in one fix.
### How to reproduce?
1. Build a workflow whose source has at least one string column and two numeric ones.
2. Connect it to a Bar Chart. Choose the string column as Value Column. A warning appears under the field: the type is string, but it is expected to be integer or long or double.
3. Connect the same source to a Scatter Matrix Chart. Choose the same string column under Selected Attributes. No warning appears, although that operator declares the same enum of numeric types.
Both operators declare the same kind of rule. Only the single-column one is enforced.
### Version/Branch
1.3.0-incubating-SNAPSHOT (main)
### Commit Hash (Optional)
9f2102e9b0d83b7b518f37bab3ae497d3a0e9b20
### What browsers are you seeing the problem on?
Chrome
### Relevant log output
None. The failure is the absence of a message.
Contributor guide
Research direction
Start at the checkAttributeType validator, its findAttributeType helper, and the setFormlyFormBinding attachment described in the issue; trace how a single attribute name differs from a list. Check the four listed operators and the Selected Features property in KNN Classifier, KNN Regressor, SVC, and SVR. Done means list-valued properties warn for invalid column types and the trainer property declares its rule.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- scala, scikit-learn
- Domain
- frontend, machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100