← baseline_full_v2

rich_3518

failed NO_PATCH NO_PATCH UNSUBMITTED empty_patch(None) · None tool calls · 0 s · Textualize/rich

Task input

fix(table): highlight columns added by add_row

## Type of changes

- [x] Bug fix
- [ ] New feature
- [ ] Documentation / docstrings
- [ ] Tests
- [ ] Other

## Checklist

- [x] I've run the latest [black](https://github.com/psf/black) with default args on new code.
- [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
- [x] I've added tests for new code.
- [x] I accept that @willmcgugan may be pedantic in the code review.

## Description

Fixes #3517. The default value for the `Column.highlight` is False, so where necessary columns are added by the `add_row` method this should default to the `Table.highlight` value.

Tool calls (0)

#ToolArgumentsResult
No trace captured.

Test output

show
...................F
=================================== FAILURES ===================================
___________________ test_columns_highlight_added_by_add_row ____________________

    def test_columns_highlight_added_by_add_row() -> None:
        """Regression test for https://github.com/Textualize/rich/issues/3517"""
        table = Table(show_header=False, highlight=True)
        table.add_row("1", repr("FOO"))
    
>       assert table.columns[0].highlight == table.highlight
E       AssertionError: assert False == True
E        +  where False = Column(header='', footer='', header_style='', footer_style='', style='', justify='left', vertical='top', overflow='ellipsis', width=None, min_width=None, max_width=None, ratio=None, no_wrap=False, highlight=False, _index=0, _cells=['1']).highlight
E        +  and   True = <rich.table.Table object at 0x1040c4690>.highlight

tests/test_table.py:371: AssertionError
!!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!!
1 failed, 19 passed in 0.15s