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
{{ message }}
Repository navigation
The object_hook param of load/loads Does Not Provide Support For MultiDict #154
I have a very large site that I pull data from that uses repeated keys. The native json (what is used for transforming website responses by requests), still provides the object_pairs_hook, however this is not supported by python-rapidjson.
I can provide a way that you can recreate it, but those two cells in the jupyter notebook are the output from the same request. I was able to replicate the lower cell's output and still use rapidjson via a lambda function, but I haven't dug into the source code yet to see what to modify to submit a pull.
So that said, what's easiest for you? You'll need requests and Werkzeug to test it.
Activity
lelit commentedon Jun 8, 2021
Can you upload here a sample of the incoming stream?
RGAlexander216 commentedon Jun 8, 2021
I can provide a way that you can recreate it, but those two cells in the jupyter notebook are the output from the same request. I was able to replicate the lower cell's output and still use rapidjson via a lambda function, but I haven't dug into the source code yet to see what to modify to submit a pull.
So that said, what's easiest for you? You'll need requests and Werkzeug to test it.
lelit commentedon Jun 9, 2021
Whatever helps to replicate the problem, as in this kind of problems, "an image is worth a thousand words" does not hold 😉
lelit commentedon Jun 9, 2021
This helped me to understand the
object_pairs_hookfunctionality.I will try to implement it, as time permits.
RGAlexander216 commentedon Jun 9, 2021
Do you still need my example?
lelit commentedon Jun 9, 2021
No, thanks.
Until I manage to implement that option, a better workaround is maybe using the
Decoder.start_object()method...RGAlexander216 commentedon Jun 9, 2021
Ah, I'll try that. Thank you!
lelit commentedon Jun 10, 2021
I've come up with a different approach that does not require a new option and is even more versatile:
What do you think?
Implement a different way to transmogrify JSON objects
lelit commentedon Jun 12, 2021
See also last entry in the incompatibilites section for another example.
lelit commentedon Jun 25, 2021
This is fixed in v1.1.