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

   <!-- Greeting -->
   Hi @2Ehecatl! I'm [Dosu](https://go.dosu.dev/dosubot) and I’m helping the 
superset team.
   
   <!-- Answer -->
   This issue with numeric(31,0) fields in PostgreSQL/Citus is a known 
limitation in Superset and its dependencies. Superset maps PostgreSQL numeric 
types to SQLAlchemy's Numeric, but for very large numbers, the frontend or 
driver may not handle them well—sometimes returning them as strings or causing 
errors. That's why casting the field to TEXT works: it bypasses the problematic 
type conversion and lets Superset display the value as a string.
   
   There isn't a Superset or database setting to change this behavior right 
now. The most reliable workaround is to cast the numeric column to TEXT (or 
BIGINT if the values fit) in your query. This approach is commonly used by 
others facing similar issues with large numeric types in Superset, and there is 
ongoing work to improve support for these cases in future releases 
[[source](https://github.com/apache/superset/issues/33174)].
   
   If you need more help, sharing the exact error message or stack trace from 
Superset's logs would help pinpoint if there's a deeper compatibility or 
environment issue. If your attached document contains more details, feel free 
to paste the relevant error text here.
   
   
   <!-- 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/ff5881f5-e0ed-481d-8771-99111122ed09?feedback_type=great_response)
 | 
[Irrelevant](https://app.dosu.dev/response-feedback/ff5881f5-e0ed-481d-8771-99111122ed09?feedback_type=irrelevant_answer)
 | 
[Incorrect](https://app.dosu.dev/response-feedback/ff5881f5-e0ed-481d-8771-99111122ed09?feedback_type=incorrect_sources)
 | 
[Verbose](https://app.dosu.dev/response-feedback/ff5881f5-e0ed-481d-8771-99111122ed09?feedback_type=too_verbose)
 | 
[Hallucination](https://app.dosu.dev/response-feedback/ff5881f5-e0ed-481d-8771-99111122ed09?feedback_type=hallucination)
 | [Report 
🐛](https://app.dosu.dev/response-feedback/ff5881f5-e0ed-481d-8771-99111122ed09?feedback_type=bug_report)
 | 
[Other](https://app.dosu.dev/response-feedback/ff5881f5-e0ed-481d-8771-99111122ed09?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%20issue%20with%20numeric%2831%2C0%29%20fields%20in%20PostgreSQL/Citus%20is%20a%20known%20limitation%20in%20Superset%20and%20its%20dependencies.%20Superset%20maps%20PostgreSQL%20numeric%20types%20to%20SQLAlchemy%27s%20Numeric%2C%20but%20for%20very%20large%20numbers%2C%20the%20frontend%20or%20driver%20may%20not%20handle%20them%20well%E2%80%94sometimes%20returning%20them%20as%20strings%20or%20causing%20errors.%20That%27s%20why%20casting%20the%20field%20to%20TEXT%20works%3A%20it%20bypasses%20the%20problematic%20type%20conversion%20and%20lets%20Superset%20display%20the%20value%20as%20a%20string.%0A%0AThere%20isn%27t%20a%20Superset%20or%20database%20setting%20to%20change%20this%20behavior%20right%20now.%20The%20most%20reliable%20workaround%20is%20to
 
%20cast%20the%20numeric%20column%20to%20TEXT%20%28or%20BIGINT%20if%20the%20values%20fit%29%20in%20your%20query.%20This%20approach%20is%20commonly%20used%20by%20others%20facing%20similar%20issues%20with%20large%20numeric%20types%20in%20Superset%2C%20and%20there%20is%20ongoing%20work%20to%20improve%20support%20for%20these%20cases%20in%20future%20releases%20%5B%5Bsource%5D%28https%3A//github.com/apache/superset/issues/33174%29%5D.%0A%0AIf%20you%20need%20more%20help%2C%20sharing%20the%20exact%20error%20message%20or%20stack%20trace%20from%20Superset%27s%20logs%20would%20help%20pinpoint%20if%20there%27s%20a%20deeper%20compatibility%20or%20environment%20issue.%20If%20your%20attached%20document%20contains%20more%20details%2C%20feel%20free%20to%20paste%20the%20relevant%20error%20text%20here.)&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)](htt
 
ps://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/apache/superset/issues/36930)


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