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
I was thinking about if I can pass my custom function to pandas' to_json to use some other json serializer, or maybe somehow access the dictionary that to_json method generates, turns out you can not do both.
Describe the solution you'd like
As seen here, the default json.dumps function is set hardcoded, a new argument can be added to to_json method like serializer_function. So that I can use any other library like orjson and pass it like df.to_json(serializer_function=orjson.dumps).
The text was updated successfully, but these errors were encountered:
Should we assume that the custom function should accept any and the other parameters provided to to_json?
Would we also want to add an engine_kwargs param just like we have done for other I/O methods? engine_kwargs could be used to pass the appropriate params to the custom serializer
Is your feature request related to a problem?
I was thinking about if I can pass my custom function to pandas'
to_json
to use some other json serializer, or maybe somehow access the dictionary thatto_json
method generates, turns out you can not do both.Describe the solution you'd like
As seen here, the default
json.dumps
function is set hardcoded, a new argument can be added toto_json
method likeserializer_function
. So that I can use any other library likeorjson
and pass it likedf.to_json(serializer_function=orjson.dumps)
.The text was updated successfully, but these errors were encountered: