Skip to content

Commit 3dc6dee

Browse files
authored
Merge pull request #668 from openml/fixes
Fix existing mypy issues
2 parents 4e3ac42 + 2db5ec8 commit 3dc6dee

4 files changed

Lines changed: 6 additions & 7 deletions

File tree

openml/datasets/dataset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
from collections import OrderedDict
12
import gzip
23
import io
34
import logging
45
import os
56
import pickle
6-
from collections import OrderedDict
7+
from typing import List, Optional, Union
78

89
import arff
910
import numpy as np
@@ -417,7 +418,7 @@ def _download_data(self) -> None:
417418
from .functions import _get_dataset_arff
418419
self.data_file = _get_dataset_arff(self)
419420

420-
def get_data(self, target: str = None,
421+
def get_data(self, target: Optional[Union[List[str], str]] = None,
421422
include_row_id: bool = False,
422423
include_ignore_attributes: bool = False,
423424
return_categorical_indicator: bool = False,

openml/datasets/functions.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,10 +375,7 @@ def get_dataset(dataset_id: Union[int, str], download_data: bool = True) -> Open
375375
features = _get_dataset_features(did_cache_dir, dataset_id)
376376
qualities = _get_dataset_qualities(did_cache_dir, dataset_id)
377377

378-
if download_data:
379-
arff_file = _get_dataset_arff(description)
380-
else:
381-
arff_file = None
378+
arff_file = _get_dataset_arff(description) if download_data else None
382379

383380
remove_dataset_cache = False
384381
except OpenMLServerException as e:

openml/flows/functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def get_flow(flow_id: int, reinstantiate: bool = False) -> OpenMLFlow:
7979
The OpenML flow id.
8080
8181
reinstantiate: bool
82-
Whether to reinstantiate the flow to a sklearn model.
82+
Whether to reinstantiate the flow to a model instance.
8383
8484
Returns
8585
-------

tests/test_study/test_study_examples.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def test_Figure1a(self):
2626
print('URL for run: %s/run/%d' %(openml.config.server,run.run_id))
2727
""" # noqa: E501
2828
import openml
29+
import sklearn.metrics
2930
import sklearn.pipeline
3031
import sklearn.preprocessing
3132
import sklearn.tree

0 commit comments

Comments
 (0)