-
Notifications
You must be signed in to change notification settings - Fork 4k
Refactor Pandas styler handling in frontend #10183
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
Conversation
| } | ||
|
|
||
| /** | ||
| * Generate a table index or data cell from a Quiver object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's the difference between a table index and a data cell? Why can the function return both? Is there a way to provide an example in the JSDoc here of how this looks like? When not being deep into this Arrow-stuff, I find it a little bit tough to understand what exactly is returned here.
Also, perhaps it makes sense to rename the function to generateTableCellOrIndex.
Or do you mean either an "index cell" or a "data cell"? But not sure whether this even makes sense conceptually (like how would a cell be an index 😅)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or do you mean either an "index cell" or a "data cell"?
Yep, I updated the comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And the index cell vs data cell distinction is not so important for arrowtable, the only difference is that it is using a greyed-out color
| } | ||
|
|
||
| /** Return a single cell in the table. */ | ||
| /** Return a single index or data cell from the DataFrame. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, what is an index cell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Index cell is a cell from an index columm. An index column refers to the index from Pandas. Therefore, it only exists if the data was processed through Pandas. Unfortunately, it needs a bit of special treatment in our data handling :(
## Describe your changes Separates Pandas Styler handling in the frontend into a dedicated utils module. This also extracts the logic around styled cells & headers from the `getCell` Quiver method to separate raw data handling and handling of styling information. Also changes `getCell` to only return actual data cells and not column header names as well. The changes in this PR do not change any visual or behavioral changes. ## Testing Plan - Added and updated unit tests. - Added additional e2e screenshot test for advanced pandas styler usage with `st.table` --- **Contribution License Agreement** By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.
Describe your changes
Separates Pandas Styler handling in the frontend into a dedicated utils module. This also extracts the logic around styled cells & headers from the
getCellQuiver method to separate raw data handling and handling of styling information. Also changesgetCellto only return actual data cells and not column header names as well.The changes in this PR do not change any visual or behavioral changes.
Testing Plan
st.tableContribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.