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 @@ -2153,6 +2153,16 @@ def is_object(self) -> bool:
2153
2153
return self .values .dtype .kind == "O"
2154
2154
2155
2155
2156
+ class NumericBlock (NumpyBlock ):
2157
+ # this Block type is kept for backwards-compatibility
2158
+ __slots__ = ()
2159
+
2160
+
2161
+ class ObjectBlock (NumpyBlock ):
2162
+ # this Block type is kept for backwards-compatibility
2163
+ __slots__ = ()
2164
+
2165
+
2156
2166
class NDArrayBackedExtensionBlock (libinternals .NDArrayBackedBlock , EABackedBlock ):
2157
2167
"""
2158
2168
Block backed by an NDArrayBackedExtensionArray
You can’t perform that action at this time.
0 commit comments