File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
giskard/ml_worker/websocket Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1- from typing import Any , Dict , List , Optional
2-
31import logging
42import os
53import posixpath
64import shutil
75from pathlib import Path
6+ from typing import Any , Dict , List , Optional
87
98from mlflow .store .artifact .artifact_repo import verify_artifact_path
109
@@ -277,6 +276,7 @@ def map_suite_input_ws(i: websocket.SuiteInput):
277276
278277def function_argument_to_ws (value : Dict [str , Any ]):
279278 args = list ()
279+ kwargs = dict ()
280280
281281 for v in value :
282282 obj = value [v ]
@@ -310,10 +310,18 @@ def function_argument_to_ws(value: Dict[str, Any]):
310310 funcargs = websocket .FuncArgument (name = v , str = obj , none = False )
311311 elif isinstance (obj , bool ):
312312 funcargs = websocket .FuncArgument (name = v , bool = obj , none = False )
313- elif isinstance (obj , dict ):
314- funcargs = websocket .FuncArgument (name = v , kwargs = str (obj ), none = False )
315313 else :
316- raise IllegalArgumentError ("Unknown argument type" )
314+ kwargs [v ] = obj
315+ continue
317316 args .append (funcargs )
318317
318+ if len (kwargs ) > 0 :
319+ args .append (
320+ websocket .FuncArgument (
321+ name = "kwargs" ,
322+ kwargs = "\n " .join ([f"kwargs[{ repr (key )} ] = { repr (value )} " for key , value in kwargs .items ()]),
323+ none = False ,
324+ )
325+ )
326+
319327 return args
You can’t perform that action at this time.
0 commit comments