Unverified Commit 465989f9 authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[python-package] fix mypy error about type change in Dataset.feature_num_bin() (#5447)

parent be7f3213
......@@ -2485,10 +2485,12 @@ class Dataset:
"""
if self.handle is not None:
if isinstance(feature, str):
feature = self.feature_name.index(feature)
feature_index = self.feature_name.index(feature)
else:
feature_index = feature
ret = ctypes.c_int(0)
_safe_call(_LIB.LGBM_DatasetGetFeatureNumBin(self.handle,
ctypes.c_int(feature),
ctypes.c_int(feature_index),
ctypes.byref(ret)))
return ret.value
else:
......
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