dosubot[bot] commented on issue #36946:
URL: https://github.com/apache/superset/issues/36946#issuecomment-3717887844

   <!-- Greeting -->
   Hi @rudak! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   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](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasets/schemas.py#L77-L93),
 
[api.py](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasets/api.py#L190-L447),
 and [models.py](https://github.c
 
om/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/connectors/sqla/models.py#L1043-L1117).
   
   Recent pull requests have improved metric editing and validation in the 
frontend, which may address this issue ([PR 
#36760](https://github.com/apache/superset/pull/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:
   
   ```json
   "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.
   
   
   <!-- Dosu Comment Footer -->
   *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).*
   
   ---
   <sup>How did I do? 
[Good](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/914c5a6a-aed2-469e-b1ba-b65c166c10d9?feedback_type=other)</sup>
   
   [![Chat with 
Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/a28d3c7e-a9d3-459e-9fb6-3a6f9ff4f357/ask?utm_source=github)&nbsp;[![Open
 in 
Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20error%20is%20caused%20by%20a%20mismatch%20between%20what%20the%20backend%20expects%20for%20the%20metric%20currency%20configuration%20and%20what%20the%20frontend%20is%20sending.%20The%20backend%20expects%20the%20currency%20field%20to%20be%20a%20JSON%20object%20with%20two%20string%20properties%E2%80%94symbol%20and%20symbolPosition%E2%80%94each%20between%201%20and%20128%20characters%20in%20length.%20However%2C%20the%20error%20and%20the%20way%20the%20payload%20is%20interpreted%20suggest%20that%20the%20frontend%20is%20sending%20a%20stringified%20object%20or%20otherwise%20mis-serializing%20the%20currency%20configuration%2C%20so%20the%20backend%20tries%20to%20validate%20each%20character%20as%20if%20it%20were%20a%20string%20field%2C%20resulting%20in
 
%20the%20%22Length%20must%20be%20between%201%20and%20128%22%20error%20for%20each%20character%20in%20the%20payload.%20You%20can%20see%20the%20backend%20schema%20and%20validation%20logic%20here%3A%20%5Bschemas.py%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasets/schemas.py%23L77-L93%29%2C%20%5Bapi.py%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/datasets/api.py%23L190-L447%29%2C%20and%20%5Bmodels.py%5D%28https%3A//github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset/connectors/sqla/models.py%23L1043-L1117%29.%0A%0ARecent%20pull%20requests%20have%20improved%20metric%20editing%20and%20validation%20in%20the%20frontend%2C%20which%20may%20address%20this%20issue%20%28%5BPR%20%2336760%5D%28https%3A//github.com/apache/superset/pull/36760%29%2C%20merged%202026-01-06%29.%20If%20possible%2C%20try%20upgrading%20to%20the%20latest%20version%20of%20Superset%2C%20as%
 
20these%20changes%20may%20resolve%20the%20serialization%20and%20validation%20mismatch.%0A%0AAs%20a%20workaround%20in%20your%20current%20version%2C%20you%20could%20try%20manually%20editing%20the%20metric%27s%20currency%20configuration%20in%20the%20dataset%27s%20JSON%20metadata%20%28if%20accessible%29%2C%20ensuring%20it%20matches%20the%20expected%20object%20structure%3A%0A%0A%60%60%60json%0A%22currency%22%3A%20%7B%0A%20%20%22symbol%22%3A%20%22EUR%22%2C%0A%20%20%22symbolPosition%22%3A%20%22suffix%22%0A%7D%0A%60%60%60%0A%0AIf%20you%20continue%20to%20encounter%20this%20error%20after%20upgrading%2C%20it%20may%20be%20worth%20reviewing%20how%20the%20frontend%20is%20serializing%20the%20currency%20field%20or%20checking%20for%20any%20customizations%20that%20could%20affect%20this%20behavior.)&nbsp;[![Join
 
Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share
 on X](https://img.shields.io/badge/X-share-black)](https:
 
//twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36946)


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