File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 36
36
# this is preserved here for downstream compatibility (GH-33892)
37
37
"create_block_manager_from_blocks" ,
38
38
]
39
+
40
+
41
+ def __getattr__ (name : str ):
42
+ import warnings
43
+
44
+ from pandas .util ._exceptions import find_stack_level
45
+
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
+ warnings .warn (
56
+ f"{ name } is deprecated and will be removed in a future version. "
57
+ "Use NumpyBlock instead." ,
58
+ DeprecationWarning ,
59
+ stacklevel = find_stack_level (),
60
+ )
61
+ return block_type
62
+
63
+ raise AttributeError (f"module 'pandas.core.internals' has no attribute '{ name } '" )
Original file line number Diff line number Diff line change @@ -2155,6 +2155,16 @@ def is_object(self) -> bool:
2155
2155
return self .values .dtype .kind == "O"
2156
2156
2157
2157
2158
+ class NumericBlock (NumpyBlock ):
2159
+ # this Block type is kept for backwards-compatibility
2160
+ __slots__ = ()
2161
+
2162
+
2163
+ class ObjectBlock (NumpyBlock ):
2164
+ # this Block type is kept for backwards-compatibility
2165
+ __slots__ = ()
2166
+
2167
+
2158
2168
class NDArrayBackedExtensionBlock (libinternals .NDArrayBackedBlock , EABackedBlock ):
2159
2169
"""
2160
2170
Block backed by an NDArrayBackedExtensionArray
You can’t perform that action at this time.
0 commit comments