Allow pytz.exceptions.NonExistentTimeError in restricted python to catch error of pd API
Hello,
When using the public API of pandas (which is partially allowed in restricted python), it can happen that this public API raises the error pytz.exceptions.NonExistentTimeError. Users should be allowed to import and therefore catch this exception.
Before this patch we could only do:
>>> try:
... ts.tz_localize(tz)
... except Exception:
... ...
After this patch we can do;
>>> try:
... ts.tz_localize(tz)
... except pytz.exceptions.NonExistentTimeError:
... ...
We use this in some scripts in the WWM project.
I can't think of any security issues when allowing this exception.
As far as I can see it's really just an unaltered subclass of Exception
.
I already submitted a test run on a test node. There are some failed tests, but I don't think they are related.
Best, Levin