|
1 | 1 | import operator
|
2 | 2 | from operator import le, lt
|
3 | 3 | import textwrap
|
4 |
| -from typing import TYPE_CHECKING, Optional, Tuple, TypeVar, Union, cast |
| 4 | +from typing import TYPE_CHECKING, Optional, Sequence, Tuple, Type, TypeVar, Union, cast |
5 | 5 |
|
6 | 6 | import numpy as np
|
7 | 7 |
|
@@ -724,7 +724,9 @@ def equals(self, other) -> bool:
|
724 | 724 | )
|
725 | 725 |
|
726 | 726 | @classmethod
|
727 |
| - def _concat_same_type(cls, to_concat): |
| 727 | + def _concat_same_type( |
| 728 | + cls: Type[IntervalArrayT], to_concat: Sequence[IntervalArrayT] |
| 729 | + ) -> IntervalArrayT: |
728 | 730 | """
|
729 | 731 | Concatenate multiple IntervalArray
|
730 | 732 |
|
@@ -1470,10 +1472,19 @@ def _get_combined_data(
|
1470 | 1472 | axis=1,
|
1471 | 1473 | )
|
1472 | 1474 | else:
|
1473 |
| - left = cast(Union["DatetimeArray", "TimedeltaArray"], left) |
1474 |
| - right = cast(Union["DatetimeArray", "TimedeltaArray"], right) |
1475 |
| - combined = type(left)._concat_same_type( |
1476 |
| - [left.reshape(-1, 1), right.reshape(-1, 1)], |
| 1475 | + # error: Item "type" of "Union[Type[Index], Type[ExtensionArray]]" has |
| 1476 | + # no attribute "_concat_same_type" [union-attr] |
| 1477 | + |
| 1478 | + # error: Unexpected keyword argument "axis" for "_concat_same_type" of |
| 1479 | + # "ExtensionArray" [call-arg] |
| 1480 | + |
| 1481 | + # error: Item "Index" of "Union[Index, ExtensionArray]" has no |
| 1482 | + # attribute "reshape" [union-attr] |
| 1483 | + |
| 1484 | + # error: Item "ExtensionArray" of "Union[Index, ExtensionArray]" has no |
| 1485 | + # attribute "reshape" [union-attr] |
| 1486 | + combined = type(left)._concat_same_type( # type: ignore[union-attr,call-arg] |
| 1487 | + [left.reshape(-1, 1), right.reshape(-1, 1)], # type: ignore[union-attr] |
1477 | 1488 | axis=1,
|
1478 | 1489 | )
|
1479 | 1490 | return combined
|
0 commit comments