当使用pivot table的时候,没有的值会使用null默认,如果想改为空或者0 需要修改源码

文件位置  superset/viz.py

找到这段代码

        return dict(
            columns=list(df.columns),
            html=df.to_html(
                na_rep="null",
                classes=(
                    "dataframe table table-striped table-bordered "
                    "table-condensed table-hover"
                ).split(" "),
            ),
        )
na_rep="null" 这个就是默认的值,修改为你想改成的值

如 na_rep="" 或 na_rep="0"

更多推荐