You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Sync columns toast is incomplete in 5.0.0rc3 #33733
I added a column to a table and hit "sync columns" on the dataset. I expected a message telling me I had one new column, instead I got "Added %s new columns to the virtual dataset" :
Screenshots/recordings
No response
Superset version
master / latest-dev
Python version
3.9
Node version
16
Browser
Firefox
Additional context
No response
Checklist
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.
This looks like a formatting bug in the toast message for syncing columns. The frontend expects to interpolate the number of new columns into the message, but if the backend doesn't return the expected value (for example, if diff.added is missing or not an array), you'll see the raw %s placeholder instead of a number. This can happen if there's an issue with how the backend computes or returns the column diff, or if the frontend doesn't properly handle null/undefined values when displaying the toast. Ensuring the backend always returns diff.added as an array and the frontend checks for valid values before rendering the message should resolve this issue. The bug is in how the frontend and backend coordinate the data for this toast message, not in your environment or browser configuration. More details on the frontend logic can be found here.
You can fix the incomplete toast by making the toast message logic in updateColumns more defensive. Even though columnChanges.added is always initialized as an array, it's good practice to future-proof against accidental null/undefined assignments. Change the toast call from:
if(columnChanges.added.length){addSuccessToast(tn('Added 1 new column to the virtual dataset','Added %s new columns to the virtual dataset',columnChanges.added.length,),);}
to:
if((columnChanges.added||[]).length){addSuccessToast(tn('Added 1 new column to the virtual dataset','Added %s new columns to the virtual dataset',(columnChanges.added||[]).length,),);}
This ensures the %s placeholder always gets a valid number, even if added is ever undefined or null due to future changes or unexpected data. You may want to apply the same pattern to the modified and removed arrays for consistency. Reference
Activity
dosubot commentedon Jun 10, 2025
This looks like a formatting bug in the toast message for syncing columns. The frontend expects to interpolate the number of new columns into the message, but if the backend doesn't return the expected value (for example, if
diff.addedis missing or not an array), you'll see the raw%splaceholder instead of a number. This can happen if there's an issue with how the backend computes or returns the column diff, or if the frontend doesn't properly handle null/undefined values when displaying the toast. Ensuring the backend always returnsdiff.addedas an array and the frontend checks for valid values before rendering the message should resolve this issue. The bug is in how the frontend and backend coordinate the data for this toast message, not in your environment or browser configuration. More details on the frontend logic can be found here.To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.
rusackas commentedon Jun 10, 2025
@dosu can you suggest a code change here?
dosubot commentedon Jun 10, 2025
You can fix the incomplete toast by making the toast message logic in
updateColumnsmore defensive. Even thoughcolumnChanges.addedis always initialized as an array, it's good practice to future-proof against accidental null/undefined assignments. Change the toast call from:to:
This ensures the
%splaceholder always gets a valid number, even ifaddedis ever undefined or null due to future changes or unexpected data. You may want to apply the same pattern to themodifiedandremovedarrays for consistency.Reference
To reply, just mention @dosu.
Docs are dead. Just use Dosu.