superset icon indicating copy to clipboard operation
superset copied to clipboard

Error saving dataset The schema of the submitted payload is invalid.

Open rudak opened this issue 10 months ago • 1 comments

Bug description

When editing a dataset and configuring a column to display a currency suffix, I encounter a validation error when saving the dataset.

Steps:

Go to a dataset -> Edit -> Edit a Metrics column

Set the Metric currency with:

symbol position: suffix symbol: EUR

Save the dataset

At this point, saving fails with the following error:

Error saving dataset The schema of the submitted payload is invalid.

Length must be between 1 and 128.: {"0":"{","1":"'","2":"s","3":"y","4":"m","5":"b","6":"o","7":"l","8":"'","9":":","10":" ","11":"'","12":"E","13":"U","14":"R","15":"'","16":",","17":" ","18":"'","19":"s","20":"y","21":"m","22":"b","23":"o","24":"l","25":"P","26":"o","27":"s","28":"i","29":"t","30":"i","31":"o","32":"n","33":"'","34":":","35":" ","36":"'","37":"s","38":"u","39":"f","40":"f","41":"i","42":"x","43":"'","44":"}","symbolPosition":"suffix","symbol":"EUR"}

Image

It looks like the UI submits a JSON object for the currency configuration, but the backend schema expects a string with a maximum length of 128 characters. The payload appears to be interpreted character by character instead of as a valid string.

Version

Superset 5.0.0

Screenshots/recordings

``

Superset version

5.0.0

Python version

3.11

Node version

I don't know

Browser

Firefox

Additional context

No response

Checklist

  • [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [ ] 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.

rudak avatar Jan 07 '26 08:01 rudak

Hi @rudak! I'm Dosu and I’m helping the superset team.

This error is caused by a mismatch between what the backend expects for the metric currency configuration and what the frontend is sending. The backend expects the currency field to be a JSON object with two string properties—symbol and symbolPosition—each between 1 and 128 characters in length. However, the error and the way the payload is interpreted suggest that the frontend is sending a stringified object or otherwise mis-serializing the currency configuration, so the backend tries to validate each character as if it were a string field, resulting in the "Length must be between 1 and 128" error for each character in the payload. You can see the backend schema and validation logic here: schemas.py, api.py, and models.py.

Recent pull requests have improved metric editing and validation in the frontend, which may address this issue (PR #36760, merged 2026-01-06). If possible, try upgrading to the latest version of Superset, as these changes may resolve the serialization and validation mismatch.

As a workaround in your current version, you could try manually editing the metric's currency configuration in the dataset's JSON metadata (if accessible), ensuring it matches the expected object structure:

"currency": {
  "symbol": "EUR",
  "symbolPosition": "suffix"
}

If you continue to encounter this error after upgrading, it may be worth reviewing how the frontend is serializing the currency field or checking for any customizations that could affect this behavior.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Jan 07 '26 08:01 dosubot[bot]

Let us know if the bot suggestion helped... if not, maybe @kgabryje can help here, as he's worked on the currency bits in the past. @msyavuz can you recall who was working on the updated currency handling?

rusackas avatar Jan 26 '26 18:01 rusackas

@rusackas I think @richardfogaca had a pr recently for dynamic currencies

msyavuz avatar Jan 26 '26 19:01 msyavuz

I'm working on a fix @rusackas @msyavuz

richardfogaca avatar Jan 26 '26 20:01 richardfogaca

PR approved!

rusackas avatar Feb 19 '26 22:02 rusackas