Maybe drop the series=None default and the _if_ statement below? Looks like it is always passed in and the code would fail without it anyway.