def _cast_sparse_series_op(left, right, opname):
from pandas.core.sparse.api import SparseDtype<EOL>opname = opname.strip('<STR_LIT:_>')<EOL>if is_integer_dtype(left) and is_integer_dtype(right):<EOL><INDENT>if opname in ('<STR_LIT>', '<STR_LIT>') and (right.values == <NUM_LIT:0>).any():<EOL><INDENT>left = left.astype(SparseDtype(np.float64, left.fill_value))<EOL>right = right.astype(SparseDtype(np.float64, right.fill_value))<EOL><DEDENT>elif opname in ('<STR_LIT>', '<STR_LIT>') and (left.values == <NUM_LIT:0>).any():<EOL><INDENT>left = left.astype(SparseDtype(np.float64, left.fill_value))<EOL>right = right.astype(SparseDtype(np.float64, right.fill_value))<EOL><DEDENT><DEDENT>return left, right<EOL>
For SparseSeries operation, coerce to float64 if the result is expected
to have NaN or inf values

Parameters
----------
left : SparseArray
right : SparseArray
opname : str

Returns
-------
left : SparseArray
right : SparseArray