Skip to content

Commit

Permalink
[python-package] Some mypy fixes (#3916)
Browse files Browse the repository at this point in the history
* Some mypy fixes

* address James' comments

* Re-introduce pass in empty classes

* Update compat.py

Remove extra lines
  • Loading branch information
AlbertoEAF authored Mar 15, 2021
1 parent dc1bc23 commit 296b2a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion python-package/lightgbm/callback.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def __init__(self, best_iteration, best_score):

# Callback environment used by callbacks
CallbackEnv = collections.namedtuple(
"LightGBMCallbackEnv",
"CallbackEnv",
["model",
"params",
"iteration",
Expand Down
12 changes: 6 additions & 6 deletions python-package/lightgbm/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
except ImportError:
PANDAS_INSTALLED = False

class pd_Series:
class pd_Series: # type: ignore
"""Dummy class for pandas.Series."""

pass

class pd_DataFrame:
class pd_DataFrame: # type: ignore
"""Dummy class for pandas.DataFrame."""

pass
Expand Down Expand Up @@ -49,7 +49,7 @@ class pd_DataFrame:
except ImportError:
DATATABLE_INSTALLED = False

class dt_DataTable:
class dt_DataTable: # type: ignore
"""Dummy class for datatable.DataTable."""

pass
Expand Down Expand Up @@ -123,17 +123,17 @@ def _check_sample_weight(sample_weight, X, dtype=None):
default_client = None
wait = None

class dask_Array:
class dask_Array: # type: ignore
"""Dummy class for dask.array.Array."""

pass

class dask_DataFrame:
class dask_DataFrame: # type: ignore
"""Dummy class for dask.dataframe.DataFrame."""

pass

class dask_Series:
class dask_Series: # type: ignore
"""Dummy class for dask.dataframe.Series."""

pass

0 comments on commit 296b2a2

Please sign in to comment.