New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpy2 raises RecursionError on simple vector/list consumption #866
Comments
Looks like it has something to do with 3.5.0 changes inside pandas2ri.conversion. Here is a pure Python script reproducing the problem:
What I see from my debugging is that earlier in 3.4.5 pandas2ri converter used singledispatch mechanism to handle ListSexpVector, which in turn called numpy2ri converter that bounced back to default_converter and through _rpy2py_nc_map mechanism the ListVector implementation was used in the end. Now in 3.5.0 pandas2ri converter uses _rpy2py_nc_map to register handler for ListSexpVector instead of singledispatch. That handler calls numpy2ri and then goes back to default_converter. However now the default_converter ListSexpVector handler sees the _rpy2py_nc_map of the overlayed pandas2ri which points again to numpy2ri, and here you have infinite recursion. |
Thanks for the report and looking for the source of the error. This is fixed in the dev branch and will be included in the bugfix release 3.5.1 (to happen by tomorrow). |
It did not seem to solve the issue with robjects.r(). Please run my code that I posted earlier to reproduce |
The issue still seems to be present. |
After checking, it seems that the issue was fixed for the ipython converter only. |
This appears fixed in current dev branch (future 3.5.3). Closing, hopefully for good. |
Describe the issue or bug
In rpy2 3.5.0, even very simple vector/list input to R magic fails to run with
RecursionError
Tested the following in the same environment just with different rpy2 versions
This works just fine in 3.4.5
To Reproduce
Try to pass any list to R magic.
or even weirdly,
yields the same failure as version output is a vector
Expected behavior
R magic should work with simple list/vector
Error
attached above.
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: