Skip to content

Commit

Permalink
Stricter test
Browse files Browse the repository at this point in the history
  • Loading branch information
borchero committed Nov 22, 2023
1 parent e965af2 commit c5acae7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2584,7 +2584,7 @@ def set_field(
# 'init_score'.
if _is_pyarrow_table(data):
if field_name != "init_score":
raise ValueError("pyarrow table provided for field other than init_score")
raise ValueError(f"pyarrow tables are not supported for field '{field_name}'")
data = pa_chunked_array([
chunk for array in data.columns for chunk in array.chunks # type: ignore
])
Expand Down
4 changes: 2 additions & 2 deletions tests/python_package_test/test_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,5 +251,5 @@ def test_dataset_construct_init_scores_table():
dataset.construct()

actual = dataset.get_init_score()
assert actual.dtype == np.float64
assert actual.shape == (5, 3)
expected = init_scores.to_pandas().to_numpy().astype(np.float64)
np_assert_array_equal(expected, actual, strict=True)

0 comments on commit c5acae7

Please sign in to comment.