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

Tabulator: don't attempt to set text_align on Bokeh formatters that don't support it #6010

Merged
merged 2 commits into from
Dec 8, 2023

Conversation

maximlt
Copy link
Member

@maximlt maximlt commented Dec 7, 2023

I got pretty much the same error as reported in #5915 and fixed in #5922, where the code fails while trying to set text_align on a Bokeh formatter that doesn't support this attribute. #5922 fixed that for the index but it applies to any other column too.

import pandas as pd
import panel as pn

from bokeh.models import HTMLTemplateFormatter

df = pd.DataFrame(dict(x=['a', 'b']))

pn.widgets.Tabulator(
    df,
    widths=300,
    text_align=dict(x='center'),
    formatters=dict(x=HTMLTemplateFormatter(template='<b><%= value %></b>'))
).servable()

@maximlt maximlt requested a review from hoxbro December 7, 2023 14:41
@maximlt maximlt marked this pull request as draft December 7, 2023 14:44
@maximlt maximlt marked this pull request as ready for review December 7, 2023 15:06
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (7bc8c83) 84.42% compared to head (fb45da9) 38.31%.

Files Patch % Lines
panel/tests/widgets/test_tables.py 33.33% 4 Missing ⚠️
panel/widgets/tables.py 75.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6010       +/-   ##
===========================================
- Coverage   84.42%   38.31%   -46.12%     
===========================================
  Files         291      291               
  Lines       43576    43571        -5     
===========================================
- Hits        36789    16693    -20096     
- Misses       6787    26878    +20091     
Flag Coverage Δ
ui-tests 38.31% <50.00%> (-2.43%) ⬇️
unitexamples-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@philippjfr
Copy link
Member

Merging, pyvista related example is failing but that was already fixed in a separate PR.

@philippjfr philippjfr merged commit efce3ad into main Dec 8, 2023
8 of 13 checks passed
@philippjfr philippjfr deleted the fix_text_align_formatter_col branch December 8, 2023 10:56
philippjfr pushed a commit that referenced this pull request Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants