Abdulrehman-PIAIC80387 opened a new pull request, #40969:
URL: https://github.com/apache/superset/pull/40969
### SUMMARY
Fixes #40934.
\`DashboardPermalinkStateSchema.activeTabs\` is a Marshmallow
\`fields.List(fields.String(), allow_none=True)\`. The list itself accepts
\`None\`, but each **element** inside the list is a \`fields.String()\` without
\`allow_none\`, so a list containing a \`None\` (e.g. \`[\"TAB-abc\", null,
\"TAB-xyz\"]\`) fails validation with:
\`\`\`json
{ \"message\": \"{'activeTabs': {N: ['Field may not be null.']}}\" }
\`\`\`
That is exactly the shape v5-exported dashboards persist when one or more
tab levels has no active child. Importing such a dashboard into v6 and
generating a permalink fails systematically.
This PR adds \`allow_none=True\` to the inner \`fields.String\` so \`None\`
entries are accepted while the outer list and the per-entry string typing are
otherwise preserved.
### BEFORE / AFTER
| | Before | After |
|---|---|---|
| \`activeTabs: [\"a\", null, \"b\"]\` | Validation error | Loaded as-is |
| \`activeTabs: None\` (whole list null) | Loaded as None (unchanged) |
Loaded as None (unchanged) |
| \`activeTabs: [\"a\", 42]\` (non-string entry) | Validation error | Still
rejected — defensive |
### TESTING INSTRUCTIONS
\`\`\`bash
pytest tests/unit_tests/dashboards/schema_tests.py -v
\`\`\`
Three new tests assert:
| Test | Behavior |
|---|---|
| \`test_permalink_state_schema_accepts_null_in_active_tabs\` | The reported
v5 import case is now accepted |
| \`test_permalink_state_schema_still_accepts_null_active_tabs_list\` | The
pre-existing \`allow_none\` on the outer list is unchanged |
| \`test_permalink_state_schema_still_rejects_non_string_entries\` | The fix
does not widen the type — non-string entries are still rejected |
Manual verification:
1. Import any v5 dashboard whose \`activeTabs\` includes a \`null\` (the
issue contains a minimal repro export attached)
2. Open the dashboard and click \"Share → Copy permalink\"
3. Permalink is generated; previously it failed with the validation error
above
### ADDITIONAL INFORMATION
- [x] Has associated issue: #40934
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration (please mention any potential downtime)
- [ ] Migration is atomic, supports rollback & is backwards-compatible
- [ ] Confirm DB migration upgrade and downgrade tested
- [x] Runtime introduces no new dependencies / changes existing dependencies
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
--
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]