danepitkin commented on code in PR #33810:
URL: https://github.com/apache/arrow/pull/33810#discussion_r1087077126


##########
python/pyarrow/tests/test_table.py:
##########
@@ -1050,21 +1050,36 @@ def test_table_set_column():
     assert t2.equals(expected)
 
 
-def test_table_drop():
+def test_table_drop_columns():
     """ drop one or more columns given labels"""
     a = pa.array(range(5))
     b = pa.array([-10, -5, 0, 5, 10])
     c = pa.array(range(5, 10))
 
     table = pa.Table.from_arrays([a, b, c], names=('a', 'b', 'c'))
-    t2 = table.drop(['a', 'b'])
+    t2 = table.drop_columns(['a', 'b'])
+    t3 = table.drop_columns('a')
 
-    exp = pa.Table.from_arrays([c], names=('c',))
-    assert exp.equals(t2)
+    exp_t2 = pa.Table.from_arrays([c], names=('c',))
+    assert exp_t2.equals(t2)
+    exp_t3 = pa.Table.from_arrays([b, c], names=('b', 'c',))
+    assert exp_t3.equals(t3)
 
     # -- raise KeyError if column not in Table
     with pytest.raises(KeyError, match="Column 'd' not found"):
-        table.drop(['d'])
+        table.drop_columns(['d'])
+
+
+def test_table_drop():
+    """ test the alias of drop_columns"""
+    a = pa.array(range(5))
+    b = pa.array([-10, -5, 0, 5, 10])
+
+    table = pa.Table.from_arrays([a, b], names=('a', 'b'))
+    t2 = table.drop('b')

Review Comment:
   Thank you! I'm going to remove the warning since there is no plan for 
deprecation. Good to know for the future though!
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to