Skip to content

Commit 0778d79

Browse files
committed
Fixes pre-commit
The xgboost snippets weren't correct.
1 parent 64aad81 commit 0778d79

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/concepts/_snippets/data_loader.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import dataclasses
2+
from os import PathLike
3+
from typing import Any, Collection, Dict, Tuple, Type, Union
4+
5+
import xgboost
26

37
from hamilton.io import utils
48
from hamilton.io.data_adapters import DataLoader
@@ -14,6 +18,7 @@ def applicable_types(cls) -> Collection[Type]:
1418

1519
def load_data(self, type_: Type) -> Tuple[xgboost.XGBModel, Dict[str, Any]]:
1620
# uses the XGBoost library
21+
model = type_()
1722
model.load_model(self.path)
1823
metadata = utils.get_file_metadata(self.path)
1924
return model, metadata

docs/concepts/_snippets/data_saver.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import dataclasses
2+
from os import PathLike
3+
from typing import Any, Collection, Dict, Type, Union
4+
5+
import xgboost
26

37
from hamilton.io import utils
48
from hamilton.io.data_adapters import DataSaver

0 commit comments

Comments
 (0)