rusackas commented on code in PR #41532:
URL: https://github.com/apache/superset/pull/41532#discussion_r3493938642


##########
docs/admin_docs/configuration/configuring-superset.mdx:
##########
@@ -549,6 +549,24 @@ CELERY_BEAT_SCHEDULE = {
 
 Adjust `retention_period_days` to control how long query rows are kept. 
Companion opt-in tasks (`prune_logs`, `prune_tasks`) exist for pruning the logs 
and tasks tables; see the commented-out examples in `superset/config.py`. 
Without enabling these tasks, the metadata database will grow unbounded over 
time.
 
+## Dashboard Layout Size Limit
+
+Each dashboard stores its layout (the position, size, and nesting of every 
chart, row, and tab) as a JSON blob in the metadata database. Superset caps the 
size of this blob with `SUPERSET_DASHBOARD_POSITION_DATA_LIMIT`, which defaults 
to `65535` bytes:
+
+```python
+SUPERSET_DASHBOARD_POSITION_DATA_LIMIT = 65535
+```
+
+The default of 65535 (2¹⁶ − 1) comes from the historical maximum size of a 
MySQL `TEXT` column. When the serialized layout reaches this limit, the editor 
blocks the save and reports the current size, the limit, and this setting's 
name. A warning is shown once the layout passes 90% of the limit.

Review Comment:
   Good catch — corrected it to call out that the cap is a Python-level limit, 
since `position_json` is actually `MEDIUMTEXT` rather than `TEXT`. Thanks 
@sadpandajoe.



##########
superset-frontend/src/dashboard/components/Header/index.tsx:
##########
@@ -468,7 +468,9 @@ const Header = (): JSX.Element => {
     if (positionJSONLength >= limit) {
       boundActionCreators.addDangerToast(
         t(
-          'Your dashboard is too large. Please reduce its size before saving 
it.',
+          'Your dashboard is too large to save: the layout is %s bytes but the 
limit is %s bytes. Reduce the dashboard size (for example, split it into 
multiple dashboards) or raise the SUPERSET_DASHBOARD_POSITION_DATA_LIMIT config 
setting.',

Review Comment:
   Fair point — it measures `safeStringify(layout).length`, not bytes. Reworded 
the toast and docs to say "serialized layout length" instead. Thanks 
@sadpandajoe.



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