Unverified Commit 7fd708df authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] fix mypy errors in compat.py and libpath.py (#5711)

parent 0f7983b6
# coding: utf-8 # coding: utf-8
"""Compatibility library.""" """Compatibility library."""
from typing import List
"""pandas""" """pandas"""
try: try:
from pandas import DataFrame as pd_DataFrame from pandas import DataFrame as pd_DataFrame
...@@ -147,11 +149,11 @@ try: ...@@ -147,11 +149,11 @@ try:
except ImportError: except ImportError:
DASK_INSTALLED = False DASK_INSTALLED = False
dask_array_from_delayed = None dask_array_from_delayed = None # type: ignore[assignment]
dask_bag_from_delayed = None dask_bag_from_delayed = None # type: ignore[assignment]
delayed = None delayed = None
default_client = None default_client = None # type: ignore[assignment]
wait = None wait = None # type: ignore[assignment]
class Client: # type: ignore class Client: # type: ignore
"""Dummy class for dask.distributed.Client.""" """Dummy class for dask.distributed.Client."""
...@@ -195,4 +197,4 @@ except ImportError: ...@@ -195,4 +197,4 @@ except ImportError:
def _LGBMCpuCount(only_physical_cores: bool = True): def _LGBMCpuCount(only_physical_cores: bool = True):
return cpu_count() return cpu_count()
__all__ = [] __all__: List[str] = []
...@@ -4,7 +4,7 @@ from pathlib import Path ...@@ -4,7 +4,7 @@ from pathlib import Path
from platform import system from platform import system
from typing import List from typing import List
__all__ = [] __all__: List[str] = []
def find_lib_path() -> List[str]: def find_lib_path() -> List[str]:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment