Skip to content

Commit

Permalink
chore: backwards compatability for h2o
Browse files Browse the repository at this point in the history
  • Loading branch information
thebrianbn committed Sep 30, 2024
1 parent 4174534 commit 9232332
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions rubicon_ml/client/artifact.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def get_data(
deseralize : str, optional
Method to use to deseralize this artifact's data.
* None to disable deseralization and return the raw data.
* "h2o_binary" to use `h2o.load_model` to load the data.
* "h2o" or "h2o_binary" to use `h2o.load_model` to load the data.
* "h2o_mojo" to use `h2o.import_mojo` to load the data.
* "pickle" to use pickles to load the data.
* "xgboost" to use xgboost's JSON loader to load the data as a fitted model.
Expand All @@ -102,6 +102,13 @@ def get_data(
)
deserialize = "pickle"

if deserialize == "h2o":
warnings.warn(
"'deserialize' method 'h2o' will be deprecated in a future release,"
" please use 'h2o_binary' instead.",
DeprecationWarning,
)

for repo in self.repositories or []:
try:
if deserialize == "xgboost":
Expand All @@ -120,7 +127,10 @@ def get_data(
except Exception as err:
return_err = err
else:
if deserialize == "h2o_binary":
if deserialize in [
"h2o",
"h2o_binary",
]: # "h2o" will be deprecated in a future release
import h2o

data = h2o.load_model(
Expand Down

0 comments on commit 9232332

Please sign in to comment.