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

Harlequin may crash with empty result set #19

Closed
tconbeer opened this issue Nov 1, 2023 · 2 comments
Closed

Harlequin may crash with empty result set #19

tconbeer opened this issue Nov 1, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@tconbeer
Copy link
Owner

tconbeer commented Nov 1, 2023

╭─────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────╮
│ /home/tco/.cache/pypoetry/virtualenvs/snow-leaderboard-Su3PUE55-py3.10/lib/python3.10/site-packages/textual_fastdatatable/data_table.py:1429 in _on_idle │
│                                                                                                                                                          │
│   1426 │   │   │   # new_rows = self._new_rows.copy()                                           ╭─────────────────── locals ───────────────────╮         │
│   1427 │   │   │   new_rows: list[int] = []                                                     │        _ = Idle()                            │         │
│   1428 │   │   │   # self._new_rows.clear()                                                     │ new_rows = []                                │         │
│ ❱ 1429 │   │   │   self._update_dimensions(new_rows)                                            │     self = ResultsTable(id='t8738893884032') │         │
│   1430 │                                                                                        ╰──────────────────────────────────────────────╯         │
│   1431 │   def refresh_coordinate(self, coordinate: Coordinate) -> Self:                                                                                 │
│   1432 │   │   """Refresh the cell at a coordinate.                                                                                                      │
│                                                                                                                                                          │
│ /home/tco/.cache/pypoetry/virtualenvs/snow-leaderboard-Su3PUE55-py3.10/lib/python3.10/site-packages/textual_fastdatatable/data_table.py:1114 in          │
│ _update_dimensions                                                                                                                                       │
│                                                                                                                                                          │
│   1111 │   │   │   │   │   │   │   ]                                                                                                                     │
│   1112 │   │   │   │   │   │   )                                                                                                                         │
│   1113 │   │                                                                                                                                             │
│ ❱ 1114 │   │   data_cells_width = sum(column.render_width for column in self.ordered_columns)                                                            │
│   1115 │   │   total_width = data_cells_width + self._row_label_column_width                                                                             │
│   1116 │   │   header_height = self.header_height if self.show_header else 0                                                                             │
│   1117 │   │   self.virtual_size = Size(                                                                                                                 │
│                                                                                                                                                          │
│ ╭─────────────────────────── locals ───────────────────────────╮                                                                                         │
│ │ auto_height_rows = []                                        │                                                                                         │
│ │          console = <console width=156 ColorSystem.TRUECOLOR> │                                                                                         │
│ │         new_rows = []                                        │                                                                                         │
│ │             self = ResultsTable(id='t8738893884032')         │                                                                                         │
│ ╰──────────────────────────────────────────────────────────────╯                                                                                         │
│                                                                                                                                                          │
│ /home/tco/.cache/pypoetry/virtualenvs/snow-leaderboard-Su3PUE55-py3.10/lib/python3.10/site-packages/textual_fastdatatable/data_table.py:1114 in          │
│ <genexpr>                                                                                                                                                │
│                                                                                                                                                          │
│   1111 │   │   │   │   │   │   │   ]                                                                                                                     │
│   1112 │   │   │   │   │   │   )                                                                                                                         │
│   1113 │   │                                                                                                                                             │
│ ❱ 1114 │   │   data_cells_width = sum(column.render_width for column in self.ordered_columns)                                                            │
│   1115 │   │   total_width = data_cells_width + self._row_label_column_width                                                                             │
│   1116 │   │   header_height = self.header_height if self.show_header else 0                                                                             │
│   1117 │   │   self.virtual_size = Size(                                                                                                                 │
│                                                                                                                                                          │
│ ╭────────────────────────────────────────────────── locals ──────────────────────────────────────────────────╮                                           │
│ │     .0 = <list_iterator object at 0x7f2ad6a5fa90>                                                          │                                           │
│ │ column = Column(label=<text 'id s' [Span(3, 4, '#959077')]>, width=0, content_width=None, auto_width=True) │                                           │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                           │
│                                                                                                                                                          │
│ /home/tco/.cache/pypoetry/virtualenvs/snow-leaderboard-Su3PUE55-py3.10/lib/python3.10/site-packages/textual_fastdatatable/data_table.py:133 in           │
│ render_width                                                                                                                                             │
│                                                                                                                                                          │
│    130 │   │   """Width in cells, required to render a column."""
│    131 │   │   # +2 is to account for space padding either side of the cell                                                                              │
│    132 │   │   if self.auto_width:                                                                                                                       │
│ ❱  133 │   │   │   return max(len(self.label), self.content_width) + CELL_X_PADDING                                                                      │
│    134 │   │   else:                                                                                                                                     │
│    135 │   │   │   return self.width + CELL_X_PADDING                                                                                                    │
│    136                                                                                                                                                   │
│                                                                                                                                                          │
│ ╭───────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮                                             │
│ │ self = Column(label=<text 'id s' [Span(3, 4, '#959077')]>, width=0, content_width=None, auto_width=True) │                                             │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
@tconbeer
Copy link
Owner Author

tconbeer commented Nov 1, 2023

can repro with select 1 where false

@tconbeer tconbeer added the bug Something isn't working label Nov 1, 2023
@tconbeer tconbeer transferred this issue from tconbeer/harlequin Nov 6, 2023
@tconbeer
Copy link
Owner Author

tconbeer commented Nov 6, 2023

closed by #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant