Skip to content

Commit

Permalink
[python] Fix typehints in Sequence API (#5465)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerRUS authored Sep 5, 2022
1 parent ccc1f89 commit 649ef60
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1308,15 +1308,19 @@ def _create_sample_indices(self, total_nrow: int) -> np.ndarray:
assert sample_cnt == actual_sample_cnt.value
return indices

def _init_from_ref_dataset(self, total_nrow: int, ref_dataset: 'Dataset') -> 'Dataset':
def _init_from_ref_dataset(
self,
total_nrow: int,
ref_dataset: _DatasetHandle
) -> 'Dataset':
"""Create dataset from a reference dataset.
Parameters
----------
total_nrow : int
Number of rows expected to add to dataset.
ref_dataset : Dataset
Reference dataset to extract meta from.
ref_dataset : object
Handle of reference dataset to extract metadata from.
Returns
-------
Expand Down Expand Up @@ -1658,7 +1662,7 @@ def __sample(self, seqs: List[Sequence], total_nrow: int) -> Tuple[List[np.ndarr
def __init_from_seqs(
self,
seqs: List[Sequence],
ref_dataset: Optional["Dataset"] = None
ref_dataset: Optional[_DatasetHandle] = None
) -> "Dataset":
"""
Initialize data from list of Sequence objects.
Expand Down

0 comments on commit 649ef60

Please sign in to comment.