File tree 2 files changed +9
-4
lines changed
2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ def _get_opstr(op):
265
265
rtruediv : "/" ,
266
266
operator .floordiv : "//" ,
267
267
rfloordiv : "//" ,
268
- operator .mod : "%" ,
268
+ operator .mod : None , # TODO: Why None for mod but '%' for rmod?
269
269
rmod : "%" ,
270
270
operator .pow : "**" ,
271
271
rpow : "**" ,
Original file line number Diff line number Diff line change 1
1
from datetime import datetime , timedelta
2
2
from io import StringIO
3
+ import operator
3
4
import sys
4
5
from typing import Any
5
6
@@ -86,9 +87,13 @@ def setup_method(self, method):
86
87
87
88
@pytest .mark .parametrize ("klass" , [Series , DataFrame ])
88
89
def test_binary_ops_docs (klass , all_arithmetic_functions ):
89
- operator = all_arithmetic_functions
90
- operator_name = _get_op_name (operator , special = False )
91
- operator_symbol = _get_opstr (operator )
90
+ op = all_arithmetic_functions
91
+ operator_name = _get_op_name (op , special = False )
92
+ if op is operator .mod :
93
+ # _get_opstr returns 'None' for this operator
94
+ operator_symbol = "%"
95
+ else :
96
+ operator_symbol = _get_opstr (op )
92
97
is_reverse = operator_name .startswith ("r" )
93
98
94
99
operand1 = klass .__name__ .lower ()
You can’t perform that action at this time.
0 commit comments