Skip to content

Commit 232cde0

Browse files
jorisvandenbosschewesm
authored andcommitted
ARROW-6674: [Python] Fix or ignore the test warnings
https://issues.apache.org/jira/browse/ARROW-6674 Closes apache#5489 from jorisvandenbossche/ARROW-6674-test-warnings and squashes the following commits: 2a2bb14 <Joris Van den Bossche> ARROW-6674: Fix or ignore the test warnings Authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com> Signed-off-by: Wes McKinney <wesm+git@apache.org>
1 parent a89c803 commit 232cde0

5 files changed

Lines changed: 16 additions & 24 deletions

File tree

python/pyarrow/tests/conftest.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
'plasma',
5252
's3',
5353
'tensorflow',
54-
'flight'
54+
'flight',
55+
'slow',
56+
'requires_testing_data',
5557
]
5658

5759

@@ -70,6 +72,8 @@
7072
's3': False,
7173
'tensorflow': False,
7274
'flight': False,
75+
'slow': False,
76+
'requires_testing_data': True,
7377
}
7478

7579
try:
@@ -166,18 +170,6 @@ def bool_env(name, default=None):
166170
action='store_true', default=default,
167171
help=('Run only the {} test group'.format(group)))
168172

169-
parser.addoption('--runslow', action='store_true',
170-
default=False, help='run slow tests')
171-
172-
173-
def pytest_collection_modifyitems(config, items):
174-
if not config.getoption('--runslow'):
175-
skip_slow = pytest.mark.skip(reason='need --runslow option to run')
176-
177-
for item in items:
178-
if 'slow' in item.keywords:
179-
item.add_marker(skip_slow)
180-
181173

182174
def pytest_runtest_setup(item):
183175
only_set = False

python/pyarrow/tests/test_array.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,25 +152,25 @@ def test_to_pandas_zero_copy():
152152
arr = pa.array(range(10))
153153

154154
for i in range(10):
155-
np_arr = arr.to_pandas()
156-
assert sys.getrefcount(np_arr) == 2
157-
np_arr = None # noqa
155+
series = arr.to_pandas()
156+
assert sys.getrefcount(series) == 2
157+
series = None # noqa
158158

159159
assert sys.getrefcount(arr) == 2
160160

161161
for i in range(10):
162162
arr = pa.array(range(10))
163-
np_arr = arr.to_pandas()
163+
series = arr.to_pandas()
164164
arr = None
165165
gc.collect()
166166

167167
# Ensure base is still valid
168168

169169
# Because of py.test's assert inspection magic, if you put getrefcount
170170
# on the line being examined, it will be 1 higher than you expect
171-
base_refcount = sys.getrefcount(np_arr.base)
171+
base_refcount = sys.getrefcount(series.values.base)
172172
assert base_refcount == 2
173-
np_arr.sum()
173+
series.sum()
174174

175175

176176
@pytest.mark.nopandas

python/pyarrow/tests/test_io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ def test_compressed_recordbatch_stream(compression):
11911191
else:
11921192
raise
11931193
writer = pa.RecordBatchStreamWriter(stream, table.schema)
1194-
writer.write_table(table, chunksize=3)
1194+
writer.write_table(table, max_chunksize=3)
11951195
writer.close()
11961196
stream.close() # Flush data
11971197
buf = raw.getvalue()

python/pyarrow/tests/test_parquet.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2352,9 +2352,7 @@ def test_noncoerced_nanoseconds_written_without_exception(tempdir):
23522352
# nanosecond timestamps by default
23532353
n = 9
23542354
df = pd.DataFrame({'x': range(n)},
2355-
index=pd.DatetimeIndex(start='2017-01-01',
2356-
freq='1n',
2357-
periods=n))
2355+
index=pd.date_range('2017-01-01', freq='1n', periods=n))
23582356
tb = pa.Table.from_pandas(df)
23592357

23602358
filename = tempdir / 'written.parquet'
@@ -3025,7 +3023,7 @@ def test_write_nested_zero_length_array_chunk_failure():
30253023
# Each column is a ChunkedArray with 2 elements
30263024
my_arrays = [pa.array(batch, type=pa.struct(cols)).flatten()
30273025
for batch in data]
3028-
my_batches = [pa.RecordBatch.from_arrays(batch, pa.schema(cols))
3026+
my_batches = [pa.RecordBatch.from_arrays(batch, schema=pa.schema(cols))
30293027
for batch in my_arrays]
30303028
tbl = pa.Table.from_batches(my_batches, pa.schema(cols))
30313029
_check_roundtrip(tbl)

python/pyarrow/tests/test_serialization.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,8 @@ def deserializer(data):
520520
assert np.alltrue(new_x.view(np.ndarray) == np.zeros(3))
521521

522522

523+
@pytest.mark.filterwarnings(
524+
"ignore:the matrix subclass:PendingDeprecationWarning")
523525
def test_numpy_matrix_serialization(tmpdir):
524526
class CustomType(object):
525527
def __init__(self, val):

0 commit comments

Comments
 (0)