Fine-grained errstate handling by rkern · Pull Request #13145 · pandas-dev/pandas (original) (raw)

The precise strategy to be taken here is open for discussion. I tried to be reasonably fine-grained rather than slap a generic decorator over everything because it's easier to go that direction than the reverse. The errstate() blocks in the tests were added after fixing all of the library code. Unfortunately, these are less fine-grained than I would like because some of the tests have many lines of the form assert_array_equal(pandas_expression_to_test, expected_raw_numpy_expression) where expected_raw_numpy_expression is what is triggering the warning. It was tedious to try to rewrite all of that to wrap just expected_raw_numpy_expression.

I think I got everything exercised by the test suite except for parts of the test suite that are skipped on my machine due to dependencies. We'll see how things go in the CI.

I haven't added any new tests yet. Could do if requested.