forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a277e4a
commit fdd43c4
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import operator | ||
from decimal import Decimal | ||
|
||
import pandas as pd | ||
import pandas.util.testing as tm | ||
from pandas.tests.extension.decimal.array import DecimalArray | ||
|
||
|
||
def test_combine_from_sequence_raises(): | ||
# https://github.com/pandas-dev/pandas/issues/22850 | ||
class BadDecimalArray(DecimalArray): | ||
def _from_sequence(cls, scalars, dtype=None, copy=False): | ||
raise KeyError("For the test") | ||
|
||
ser = pd.Series(BadDecimalArray([Decimal("1.0"), Decimal("2.0")])) | ||
result = ser.combine(ser, operator.add) | ||
|
||
# note: object dtype | ||
expected = pd.Series([Decimal("2.0"), Decimal("4.0")], dtype="object") | ||
tm.assert_series_equal(result, expected) |