From 296b2a2662a1560c5baa5a0e6ec32cbe290654b9 Mon Sep 17 00:00:00 2001 From: Alberto Ferreira Date: Mon, 15 Mar 2021 19:26:02 +0000 Subject: [PATCH] [python-package] Some mypy fixes (#3916) * Some mypy fixes * address James' comments * Re-introduce pass in empty classes * Update compat.py Remove extra lines --- python-package/lightgbm/callback.py | 2 +- python-package/lightgbm/compat.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/python-package/lightgbm/callback.py b/python-package/lightgbm/callback.py index c2db7a3cf991..b5f2438545a8 100644 --- a/python-package/lightgbm/callback.py +++ b/python-package/lightgbm/callback.py @@ -26,7 +26,7 @@ def __init__(self, best_iteration, best_score): # Callback environment used by callbacks CallbackEnv = collections.namedtuple( - "LightGBMCallbackEnv", + "CallbackEnv", ["model", "params", "iteration", diff --git a/python-package/lightgbm/compat.py b/python-package/lightgbm/compat.py index fbd5dd4e3c04..2b8781ff2b88 100644 --- a/python-package/lightgbm/compat.py +++ b/python-package/lightgbm/compat.py @@ -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 @@ -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 @@ -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