Bug description

Since v5.0.0, if we have add currency suffix in the sql metrics on a dataset. We can't modify this dataset after.

Screenshots/recordings

Error message : Image Content on the metadata for the metrics : Image

After set to null the currency column. we can modify the dataset again

Superset version

5.0.0

Python version

3.11

Node version

I don't know

Browser

Not applicable

Additional context

No response

Checklist

  • [ ] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [x] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: dosubot[bot]

This is a known bug in Superset 5.0.0 caused by a migration that changed the currency field for SQL metrics from a string to a JSON object, along with stricter backend validation. If the currency field contains a legacy string or an improperly formatted value, you'll get a validation error like "Length must be between 1 and 128" and won't be able to modify the dataset. Setting the currency field to null works because it bypasses the new validation rules, letting you edit the dataset again.

A fix for this issue has already been merged and will be included in an upcoming release (5.0.1, 5.1.0, or 6.0.0). Until then, the only workaround is to remove or nullify the affected metric's currency field before making changes to the dataset. More details and confirmation of the fix are available in this GitHub issue and the merged pull request.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

Comment From: rusackas

The bot is right! I'll close this, unless the workaround isn't working. Feel free to test the 6.0 release candidate as well! :)

Comment From: ARTISnetDev

i m not sure because is not in the case that the metric is added with already exists message. It is in the case we defined the currency for each amount. In v4.X.X it worked. It is in the case we change other thing example synchronise the columns (because new one) and save. PS : unfortunatelly i can't test it quickly the candidate version. Perhaps near in 2 weeks.