You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Meanwhile, the docs state 'is expected to return a dictionary of string keys to string values representing the data payload' (same as for the graph_attrs parameter, for which the typing corresponds with the documentation).
From the rust function, the dictionary is also expected
let attr_callable = |attrs:&PyObject,obj:&PyObject| -> PyResult<BTreeMap<String,String>>{
let res = attrs.call1(py,(obj,))?;
res.extract(py)
};
On inserting a callable return a str datatype, this throws an error: E TypeError: 'str' object cannot be converted to 'PyDict'
No error is thrown on return a dict
Our type annotations are added manually, so I think you just found a mismatch in the annotations! I might bundle the fix of this with #1242 for a 0.15.2 release. And of course it will be fixed by 0.16 for sure
Information
What is the current behavior?
Both
graph
anddigraph
_node_link_json
serializers show expectedcallable
output asstr
type.rustworkx/rustworkx/rustworkx.pyi
Lines 632 to 647 in 553bff1
Meanwhile, the docs state 'is expected to return a dictionary of string keys to string values representing the data payload' (same as for the
graph_attrs
parameter, for which the typing corresponds with the documentation).From the rust function, the
dictionary
is also expectedrustworkx/src/json/node_link_data.rs
Lines 125 to 128 in 553bff1
On inserting a
callable
return astr
datatype, this throws an error:E TypeError: 'str' object cannot be converted to 'PyDict'
No error is thrown on return a
dict
What is the expected behavior?
Steps to reproduce the problem
Inserting
node_attrs=lambda x: 'a'
, which corresponds to theCallable[[_S], str] | None
typeThe text was updated successfully, but these errors were encountered: