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

Spanners use 'id' as a label and not 'label'. #273

Closed
aussetg opened this issue Apr 11, 2024 · 1 comment · Fixed by #345
Closed

Spanners use 'id' as a label and not 'label'. #273

aussetg opened this issue Apr 11, 2024 · 1 comment · Fixed by #345

Comments

@aussetg
Copy link

aussetg commented Apr 11, 2024

Description

Spanners use 'id' as a label and not 'label', despite what the documentation says.

Reproducible example

import polars as pl
from great_tables import GT

(
    GT(
        pl.DataFrame({'a': range(5), 'b': range(5)}),
    )
    .tab_spanner(label='True Label', id='false_label', columns=['a', 'b'])
)

Expected result

A spanner called 'True Label'.

Development environment

  • great_tables Version: 0.4.0
@jrycw
Copy link
Contributor

jrycw commented Apr 24, 2024

It appears that the issue originates from the following line:

spanner_ids, spanner_col_names = spanners_print_matrix(
spanners=data._spanners, boxhead=boxhead, include_hidden=False, ids=True
)

Setting ids to False seems to resolve the issue. However, this change may have implications on subsequent logic, requiring further investigation by the team.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants