Skip to content

Commit

Permalink
[python-package] fix mypy error about pyarrow data (#6333)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Feb 21, 2024
1 parent 008ebaf commit b60068c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if [[ $TASK == "lint" ]]; then
cpplint \
mypy \
'pre-commit>=3.6.0' \
'pyarrow>=14.0' \
'r-lintr>=3.1'
source activate $CONDA_ENV
echo "Linting Python code"
Expand Down
2 changes: 1 addition & 1 deletion python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ def _is_2d_collection(data: Any) -> bool:
)


def _is_pyarrow_array(data: Any) -> bool:
def _is_pyarrow_array(data: Any) -> "TypeGuard[Union[pa_Array, pa_ChunkedArray]]":
"""Check whether data is a PyArrow array."""
return isinstance(data, (pa_Array, pa_ChunkedArray))

Expand Down

0 comments on commit b60068c

Please sign in to comment.