Closed jrycw closed 2 months ago
Hey, thanks for raising this. I tested your code, and it seems to work on main?
I think this behavior is intentional, and is documented in Styling the Table Body -> Using Functions in the guide.
In any event, I think this approach with pandas makes sense, and hopefully works as is in Great Tables. If anything is needed to make it work, very happy to fix!
Thank you for your response. Initially, I was exploring the possibility of not creating a background
in the Combining Styling with cols_hide and didn't realize the callable option you mentioned. Thank you once again for your help.
Hello team,
I noticed that with the introduction of pandas.Series.case_when in pandas 2.2, there's a similarity to polars.when-then-otherwise used in our tutorial. After investigating further, I discovered that including
pdSeries
in theisinstance
check of theCellStyle._evaluate_expressions
method might offer a solution. Here's the proposed code snippet:This change allows us to use the following code:
Initial testing indicates that the proposed solution works as expected:
I'm interested in hearing your thoughts on this approach. Do you believe it's a viable idea, or do you foresee any potential issues with existing code? If we reach a consensus that this is a beneficial change, I'm prepared to submit a PR.