Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add user-friendly exception if dataframe exceeds max config of Pandas Styler #7497

Merged
merged 3 commits into from Oct 4, 2023

Conversation

LukasMasuch
Copy link
Collaborator

@LukasMasuch LukasMasuch commented Oct 4, 2023

Describe your changes

Pandas Styler has a global configuration that defines the maximum number of elements allowed to be rendered/processed. As described in #5953, if the underlying dataframe exceeds this configuration, an indescriptive KeyError will be thrown. This PR adds a more user-friendly error message if the dataframe exceeds the configured maximum with a workaround to resolve the issue:

image

GitHub Issue Link (if applicable)

Testing Plan

  • Added unit test.

Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@LukasMasuch LukasMasuch changed the title Improve pandas styler support for large dataframes Add user-friendly exception if dataframe exceeds max configuration of Pandas Styler Oct 4, 2023
@LukasMasuch LukasMasuch changed the title Add user-friendly exception if dataframe exceeds max configuration of Pandas Styler Add user-friendly exception if dataframe exceeds max config of Pandas Styler Oct 4, 2023
@LukasMasuch LukasMasuch marked this pull request as ready for review October 4, 2023 13:07
@LukasMasuch LukasMasuch merged commit 13d9022 into develop Oct 4, 2023
87 checks passed
@LukasMasuch LukasMasuch deleted the feature/improve-pandas-styler-support branch October 4, 2023 22:50
eric-skydio pushed a commit to eric-skydio/streamlit that referenced this pull request Dec 20, 2023
… Styler (streamlit#7497)

* Add better exception if styler cannot render df

* Revert change

* Add test for styler maximum
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Mar 22, 2024
… Styler (streamlit#7497)

* Add better exception if styler cannot render df

* Revert change

* Add test for styler maximum
zyxue pushed a commit to zyxue/streamlit that referenced this pull request Apr 16, 2024
… Styler (streamlit#7497)

* Add better exception if styler cannot render df

* Revert change

* Add test for styler maximum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants