File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -217,3 +217,17 @@ class TestTSLib(tm.TestCase):
217
217
def test_deprecation_access_func (self ):
218
218
with catch_warnings (record = True ):
219
219
pd .tslib .Timestamp ('20160101' )
220
+
221
+
222
+ class TestTypes (tm .TestCase ):
223
+
224
+ def test_deprecation_access_func (self ):
225
+ with tm .assert_produces_warning (
226
+ FutureWarning , check_stacklevel = False ):
227
+ from pandas .types .concat import union_categoricals
228
+ c1 = pd .Categorical (list ('aabc' ))
229
+ c2 = pd .Categorical (list ('abcd' ))
230
+ union_categoricals (
231
+ [c1 , c2 ],
232
+ sort_categories = True ,
233
+ ignore_order = True )
Original file line number Diff line number Diff line change
1
+ import warnings
2
+
3
+
4
+ def union_categoricals (to_union , sort_categories = False , ignore_order = False ):
5
+ warnings .warn ("pandas.types.concat.union_categoricals is "
6
+ "deprecated and will be removed in a future version.\n "
7
+ "use pandas.api.types.union_categoricals" ,
8
+ FutureWarning , stacklevel = 2 )
9
+ from pandas .api .types import union_categoricals
10
+ return union_categoricals (
11
+ to_union , sort_categories = sort_categories , ignore_order = ignore_order )
You can’t perform that action at this time.
0 commit comments