rusackas opened a new pull request, #41868:
URL: https://github.com/apache/superset/pull/41868

   ### SUMMARY
   
   MySQL and StarRocks return `var_string` as the native type for 
varchar-backed columns (e.g. StarRocks `VARCHAR`). Neither engine spec's 
`column_type_mappings` matched `var_string` (the existing `^varchar` pattern 
doesn't match `var_string`), so such columns fell through unmatched and were 
not classified as `GenericDataType.STRING`.
   
   Because several Explore controls gate on column type, this caused the "Force 
categorical" / y-axis sort control to be incorrectly hidden for these columns — 
the user had to cast the axis to a numeric type just to make the control 
appear, which doesn't make sense for a categorical axis.
   
   This adds a `^var_string` regex mapping resolving to 
`GenericDataType.STRING` in both `mysql.py` and `starrocks.py` (StarRocks 
defines its own full override tuple). This matches the workaround confirmed by 
the issue reporter in the thread.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   N/A — backend type-classification change.
   
   ### TESTING INSTRUCTIONS
   
   - Automated: `pytest 
tests/unit_tests/db_engine_specs/test_mysql.py::test_get_column_spec 
tests/unit_tests/db_engine_specs/test_starrocks.py::test_get_column_spec` — new 
parameterized cases assert `var_string` resolves to `GenericDataType.STRING`.
   - Manual: On a MySQL/StarRocks dataset with a varchar-backed column, create 
a bar chart using that column as the categorical (x) axis and a numeric 
measure. The "Force categorical" / y-axis sort control should now be visible 
without casting the column.
   
   ### ADDITIONAL INFORMATION
   - [x] Has associated issue: Fixes #30282
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to