fix(dataset-editor): include calculated columns in currency code dropdown #37621
+26
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
The Currency code column dropdown in the Dataset Editor excludes calculated columns, even though they are valid choices for currency code mapping (e.g. a
CASEstatement that maps country values to ISO currency codes likeUSD,EUR).Root cause: The dropdown is built from
allColumns(physical + calculated), but the filter atDatasourceEditor.jsx:1096requirestype_generic === GenericDataType.String. The backend'sfetch_metadata()only resolvestype_genericfor physical columns — calculated columns are added back to the dataset withtype_genericunset (null/undefined), so they silently fail the strict equality check.Fix: Loosen the filter to also include columns with a truthy
expressionproperty (the same signal the component already uses to distinguish calculated from physical columns at construction time). This is safe because the downstream currency detection logic already handles invalid currency codes gracefully by falling back to neutral formatting.Fixes #37620
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
Before — calculated column

num_californiais missing from the dropdown:After — calculated column

num_californianow appears in the dropdown:TESTING INSTRUCTIONS
birth_names)CASE WHEN state = 'CA' THEN 'USD' ELSE 'EUR' END)num,num_boys) do not appearUnit tests:
ADDITIONAL INFORMATION