fix(serializer): fix RecursionError without changing signature - #94
fix(serializer): fix RecursionError without changing signature#94sshishov wants to merge 1 commit into
RecursionError without changing signature#94Conversation
|
Seems not working on real package, but passing tests. checking... |
The `inspect` library is used instead to get the `caller` information. This information gives us a clue, if it is recursion call or not. Signed-off-by: Sergei Shishov <sshishov.sshishov@gmail.com>
37c67ac to
89de758
Compare
|
@sshishov thanks, I thought some frame-inspection solution could solve this, and this looks good on a first glance... but I wonder about the performance impact. Could you please try to measure what's the delay of calling |
|
Hi @fjsj , the second push working for us, I have checked. About performance penalty, how you would recommend us to test it? I have tested the solution and found one huge flaw which I do not how to solve in long term. The problem is: some renderers (like XLS renderer in pandas I guess) is using serializer to get headers information and other stuff, and usually it is used in POST method. Like POST export with some paramters. Here we should have 2 serializers, one is write (for query params) and another is read for response. Unfortunately the renderer is using You can try to reproduce it yourself in the test... |
For IO, yes. The trouble is introspection in Python can have some impact (the
Yes, that's the new behavior we introduced at #77 to fix the issues #1, #17, #44.
Not clear to me what's breaking. It's the tests or your code? |
Description: fix
RecursionErrorwithout changing signatureThe
inspectlibrary is used instead to get thecallerinformation. This information gives us a clue, if it is recursion call or not.Dependencies: this is fixes the PR where additional
default_to_serializer_classwas added to the signature