Skip to content

Sync columns toast is incomplete in 5.0.0rc3 #33733

Closed

Description

@sfirke

Bug description

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

Image

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.

Activity

  1. added
    #bug:cosmetic
    browser:firefox
    on Jun 10, 2025
  2. dosubot commented on Jun 10, 2025

    @dosubot

    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.

    To reply, just mention @dosu.


    Share context across your team and agents. Try Dosu.

    Leave Feedback Learn about superset with Dosu Add Dosu to your team

  3. rusackas commented on Jun 10, 2025

    @rusackas
    Member

    @dosu can you suggest a code change here?

  4. dosubot commented on Jun 10, 2025

    @dosubot

    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

    To reply, just mention @dosu.


    Docs are dead. Just use Dosu.

    Leave Feedback Ask Dosu about superset Share Dosu with your team

  5. moved this from New to Cherried in Apache Superset 5.0.0on Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    #bug:cosmeticbrowser:firefox

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions