Skip to content

Commit

Permalink
fix error message
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Ho authored and Colin Ho committed Nov 7, 2024
1 parent f8a22c9 commit 4fea9d7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions daft/sql/sql_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,10 @@ def _get_partition_bounds(self, num_scan_tasks: int) -> list[Any]:
pa_table = self.conn.execute_sql_query(percentile_sql)

Check warning on line 202 in daft/sql/sql_scan.py

View check run for this annotation

Codecov / codecov/patch

daft/sql/sql_scan.py#L202

Added line #L202 was not covered by tests

if pa_table.num_rows != 1:
raise RuntimeError(f"Failed to get partition bounds: expected 1 row, but got {pa_table.num_rows}.")
raise RuntimeError(f"Expected 1 row, but got {pa_table.num_rows}.")

Check warning on line 205 in daft/sql/sql_scan.py

View check run for this annotation

Codecov / codecov/patch

daft/sql/sql_scan.py#L204-L205

Added lines #L204 - L205 were not covered by tests

if pa_table.num_columns != num_scan_tasks + 1:
raise RuntimeError(
f"Failed to get partition bounds: expected {num_scan_tasks + 1} percentiles, but got {pa_table.num_columns}."
)
raise RuntimeError(f"Expected {num_scan_tasks + 1} percentiles, but got {pa_table.num_columns}.")

Check warning on line 208 in daft/sql/sql_scan.py

View check run for this annotation

Codecov / codecov/patch

daft/sql/sql_scan.py#L207-L208

Added lines #L207 - L208 were not covered by tests

pydict = Table.from_arrow(pa_table).to_pydict()
assert pydict.keys() == {f"bound_{i}" for i in range(num_scan_tasks + 1)}
Expand Down

0 comments on commit 4fea9d7

Please sign in to comment.