Skip to content

Commit

Permalink
[python-package] fix mypy errors in compat.py and libpath.py (#5711)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Feb 14, 2023
1 parent 0f7983b commit 7fd708d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions python-package/lightgbm/compat.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# coding: utf-8
"""Compatibility library."""

from typing import List

"""pandas"""
try:
from pandas import DataFrame as pd_DataFrame
Expand Down Expand Up @@ -147,11 +149,11 @@ class _LGBMRegressorBase: # type: ignore
except ImportError:
DASK_INSTALLED = False

dask_array_from_delayed = None
dask_bag_from_delayed = None
dask_array_from_delayed = None # type: ignore[assignment]
dask_bag_from_delayed = None # type: ignore[assignment]
delayed = None
default_client = None
wait = None
default_client = None # type: ignore[assignment]
wait = None # type: ignore[assignment]

class Client: # type: ignore
"""Dummy class for dask.distributed.Client."""
Expand Down Expand Up @@ -195,4 +197,4 @@ def _LGBMCpuCount(only_physical_cores: bool = True):
def _LGBMCpuCount(only_physical_cores: bool = True):
return cpu_count()

__all__ = []
__all__: List[str] = []
2 changes: 1 addition & 1 deletion python-package/lightgbm/libpath.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from platform import system
from typing import List

__all__ = []
__all__: List[str] = []


def find_lib_path() -> List[str]:
Expand Down

0 comments on commit 7fd708d

Please sign in to comment.