Jupyter/Python evalMetrics with bindings

I can’t seem to get bindings to properly be interpreted in an EvalMetricSpec when evaluating then in jupyter notebook with the c3 python library.

Here’s my command:

pred_targets = ["valid_id"]
bindings = {"marginOffset":25, "marginSpan":51}
results_DME = c3.PiElement.evalMetrics({"ids": pred_targets, "expressions": ["DowntimeMarginExclusion"], "start": "2017-01-01", "end": "2017-07-01", "interval": "TEN_MINUTE", "bindings": bindings})

Here’s my error:

C3RuntimeException: 500 - NotClassified - c3.love.typesys.obj.pipe.ObjValueIteratorBase_errorTypeMissingForObj [537.49159]
message: "Expecting specific type for fields with 'any', 'anyof' or 'Obj' type at JSON document at 1:206"
JSON: {'spec': {'end': '2017-07-01', 'interval': 'TEN_MINUTE', 'ids': ['valid_id'], 'start': '2017-01-01', 'expressions': ['DowntimeMarginExclusion'], 'bindings': [{'marginOffset': 25}, {'marginSpan': 51}]}}

I assume that I need to cast the Bindings to some type, but I can’t quite determine how to do that.

Thanks for the help!

hello, yes, you need to box your values before sending, see the post below

The following works for me if I define the bindings as such:

bindings = {"type" : "[map<string,double>]", "value" : [{"marginOffset":25, "marginSpan":51}]}