-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
!B [#7852] fix for _rrule maximum recursion depth exceeded on multiprocessing usage #7854
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I see (I think): you are using multiprocessing, which is pickling, requiring the special access method to the special methods.
yes, that is correct |
Current coverage is 62.10% (diff: 50.00%)@@ master #7854 diff @@
==========================================
Files 174 174
Lines 56065 56067 +2
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 34820 34823 +3
+ Misses 21245 21244 -1
Partials 0 0
|
Should I add a new test for this code change? |
Yes, a test would be good. Maybe in test_pickle.py? |
I struggle a bit with creation of test for this case without pandas |
Can you create a mock object whose API is close to the one from pandas? (pandas should not be added as a dependency). |
I don't think anything should depend on Pandas, or needs to here. If the problem is pickling an rrulelocator, it should be possible to test it very directly by analogy with some other tests in the test_pickle.py module. |
I agree--mocking Pandas seems a bit heavy-handed, if not wrong. If the problem is pickling, test pickling. |
We have some tests that run with pandas, you can just use it. Follow the pattern from
|
You could, but it's not really necessary to use >>> import matplotlib.dates
>>> import pickle
>>> r = matplotlib.dates.rrulewrapper(2)
>>> r
<matplotlib.dates.rrulewrapper object at 0x7f3c9de18470>
>>> pickle.loads(pickle.dumps(r))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
...
File "/home/elliott/code/matplotlib/lib/matplotlib/dates.py", line 716, in __getattr__
return getattr(self._rrule, name)
RecursionError: maximum recursion depth exceeded while calling a Python object It just needs to be wrapped up in the test functions and given better names and such. |
awesome, QuLogic, thank you for the example! |
added the test |
does anybody know how a new test could lead to failure of those checks? |
Part of the failure is our PEP8 checker, You have a blank line containing whitespaces. I suggest fixing that and let the tests rerun. I think the other failure is a random fluke |
except RecursionError: | ||
print('rrulewrapper pickling test failed') | ||
raise | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You still have a white space issue a this line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I didn't notice that
committed a change
Thanks for the patch! |
👍 to backporting, but it needs a bit more work as this 'fixes' the problem via
|
issue description:
#7852