Skip to content

Commit 88ac6c6

Browse files
author
Christian Osendorfer
committed
Fix for #2949.
Extend the set of types that are not handled by json.dumps to elementary types.
1 parent 0e4fd55 commit 88ac6c6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/sagemaker/estimator.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,9 @@ def _json_encode_hyperparameters(hyperparameters: Dict[str, Any]) -> Dict[str, A
598598
current_hyperparameters = hyperparameters
599599
if current_hyperparameters is not None:
600600
hyperparameters = {
601-
str(k): (v if isinstance(v, (Parameter, Expression, Properties)) else json.dumps(v))
601+
str(k): (v if isinstance(
602+
v, (str, int, float, bool, Parameter, Expression, Properties)
603+
) else json.dumps(v))
602604
for (k, v) in current_hyperparameters.items()
603605
}
604606
return hyperparameters

0 commit comments

Comments
 (0)