Skip to content

Commit

Permalink
ARROW-8398: [Python] Remove deprecated API usage from python tests
Browse files Browse the repository at this point in the history
Closes #6897 from kszucs/python-warnings

Authored-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
Signed-off-by: Wes McKinney <wesm+git@apache.org>
  • Loading branch information
kszucs authored and wesm committed Apr 10, 2020
1 parent 988a3f8 commit 70a8f0b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions python/pyarrow/tests/test_array.py
Expand Up @@ -54,7 +54,7 @@ def test_constructor_raises():

def test_list_format():
arr = pa.array([[1], None, [2, 3, None]])
result = arr.format()
result = arr.to_string()
expected = """\
[
[
Expand All @@ -72,7 +72,7 @@ def test_list_format():

def test_string_format():
arr = pa.array(['', None, 'foo'])
result = arr.format()
result = arr.to_string()
expected = """\
[
"",
Expand All @@ -84,7 +84,7 @@ def test_string_format():

def test_long_array_format():
arr = pa.array(range(100))
result = arr.format(window=2)
result = arr.to_string(window=2)
expected = """\
[
0,
Expand All @@ -98,7 +98,7 @@ def test_long_array_format():

def test_binary_format():
arr = pa.array([b'\x00', b'', None, b'\x01foo', b'\x80\xff'])
result = arr.format()
result = arr.to_string()
expected = """\
[
00,
Expand Down
8 changes: 4 additions & 4 deletions python/pyarrow/tests/test_plasma.py
Expand Up @@ -367,15 +367,15 @@ def test_store_arrow_objects(self):
# Write an arrow object.
object_id = random_object_id()
tensor = pa.Tensor.from_numpy(data)
data_size = pa.get_tensor_size(tensor)
data_size = pa.ipc.get_tensor_size(tensor)
buf = self.plasma_client.create(object_id, data_size)
stream = pa.FixedSizeBufferWriter(buf)
pa.write_tensor(tensor, stream)
pa.ipc.write_tensor(tensor, stream)
self.plasma_client.seal(object_id)
# Read the arrow object.
[tensor] = self.plasma_client.get_buffers([object_id])
reader = pa.BufferReader(tensor)
array = pa.read_tensor(reader).to_numpy()
array = pa.ipc.read_tensor(reader).to_numpy()
# Assert that they are equal.
np.testing.assert_equal(data, array)

Expand Down Expand Up @@ -408,7 +408,7 @@ def test_store_pandas_dataframe(self):
reader = pa.RecordBatchStreamReader(pa.BufferReader(data))
result = reader.read_next_batch().to_pandas()

pd.util.testing.assert_frame_equal(df, result)
pd.testing.assert_frame_equal(df, result)

def test_pickle_object_ids(self):
# This can be used for sharing object IDs between processes.
Expand Down

0 comments on commit 70a8f0b

Please sign in to comment.