Skip to content

sunburst errors with "Non-leaves are not permitted in the dataframe" #4774

Open
@EpigeneMax

Description

@EpigeneMax

The logic to check for non-leaves is dubious, e.g. a leaf whose name is a suffix of another leaf triggers an error.
The check also depends on the alphabetical ordering on the leaves.

As suggested by #3589, I wonder whether this non-leaf detection is really meaningful.
I'd be happy to write a PR to remove this check. Thoughts?

minimal working example

import pandas as pd
import plotly.express as px

df = pd.DataFrame(
    {
        "status": ["NOT_YET_COMPLETED", "COMPLETED"],
        "next_step": ["Wrapup", None],
        "count": [1, 2],
    }
)
# no error
px.sunburst(df, path=["status", "next_step"], values="count")

df.loc[0, "status"] = "ACTIVE_NOT_YET_COMPLETED"
# error (spurious)
px.sunburst(df, path=["status", "next_step"], values="count")

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogfeaturesomething new

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions