File tree 2 files changed +10
-9
lines changed 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -44,20 +44,19 @@ def __getattr__(name: str):
44
44
from pandas .util ._exceptions import find_stack_level
45
45
46
46
if name in ["NumericBlock" , "ObjectBlock" ]:
47
- if name == "NumericBlock" :
48
- from pandas .core .internals .blocks import NumericBlock
49
-
50
- block_type = NumericBlock
51
- elif name == "ObjectBlock" :
52
- from pandas .core .internals .blocks import ObjectBlock
53
-
54
- block_type = ObjectBlock
55
47
warnings .warn (
56
48
f"{ name } is deprecated and will be removed in a future version. "
57
49
"Use NumpyBlock instead." ,
58
50
DeprecationWarning ,
59
51
stacklevel = find_stack_level (),
60
52
)
61
- return block_type
53
+ if name == "NumericBlock" :
54
+ from pandas .core .internals .blocks import NumericBlock
55
+
56
+ return NumericBlock
57
+ else :
58
+ from pandas .core .internals .blocks import ObjectBlock
59
+
60
+ return ObjectBlock
62
61
63
62
raise AttributeError (f"module 'pandas.core.internals' has no attribute '{ name } '" )
Original file line number Diff line number Diff line change @@ -478,6 +478,8 @@ def convert(
478
478
if self .ndim != 1 and self .shape [0 ] != 1 :
479
479
return self .split_and_operate (Block .convert , copy = copy , using_cow = using_cow )
480
480
481
+ # needed for type hints
482
+ assert isinstance (self .values , np .ndarray )
481
483
values = self .values
482
484
if values .ndim == 2 :
483
485
# maybe_split ensures we only get here with values.shape[0] == 1,
You can’t perform that action at this time.
0 commit comments