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
There is a method name mismatch between the Function class implementation and the SDK's serialization expectations. The SDK attempts to call to_dict() on Function objects, but the Function class only implements toJson().
Current Behavior
When attempting to simulate or deploy custom functions, the following error occurs:
With the latest build, I ran into a similar problem. In deploy (within sdk.py), when adding the json object to the call, the customFunctions property is just the parameter custom_functions. Which causes a serialization error. This is not a problem in react or simulate, but does not happen in deploy.
The line indeploy should be changed to "customFunctions": [x.toJson() for x in custom_functions] as is in both react and simulate.
Method Mismatch in Function Serialization
Issue Description
There is a method name mismatch between the
Function
class implementation and the SDK's serialization expectations. The SDK attempts to callto_dict()
on Function objects, but the Function class only implementstoJson()
.Current Behavior
When attempting to simulate or deploy custom functions, the following error occurs:
Expected Behavior
The SDK should either:
toJson()
instead ofto_dict()
in sdk.py, orCode Analysis
In game.py
In sdk.py
Current Workaround
Users can implement a wrapper class to provide the missing method:
Suggested Fix
Option 1 (Preferred):
Option 2:
Impact
This issue affects any users trying to implement custom functions with the SDK, particularly when using the simulation or deployment features.
Additional Notes
toJson()
method works correctly when called directlyLabels
The text was updated successfully, but these errors were encountered: