Skip to content

Data Editor takes Pandas stylers object, but doesn't show the style #6928

@jeffery9876

Description

@jeffery9876

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

In streamlit 1.23.0 changelog, you said Unified the behavior between st.data_editor and st.dataframe related ...

But the style rendering between st.data_editor and st.dataframe are actually very different.

image

Reproducible Code Example

import pandas as pd
import streamlit as st

df = pd.DataFrame(data=[[1,3],[2,4]], index=[1,2], columns=['a', 'b'])
style = df.style.highlight_max(axis=1, props='color:white; font-weight:bold; background-color:darkblue;')

st.dataframe(style)
st.data_editor(style)

Steps To Reproduce

No response

Expected Behavior

st.data_editor should show the same style as st.dataframe

Current Behavior

no style in the st.data_editor

image

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version:
  • Python version:
  • Operating System:
  • Browser:
  • Virtual environment:

Additional Information

No response

Are you willing to submit a PR?

  • Yes, I am willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions