Skip to content

Commit

Permalink
Fix failing CI ORC test (#7313)
Browse files Browse the repository at this point in the history
Use a buffer for output in the newly added ORC test.

Authors:
  - Vukasin Milovanovic (@vuule)

Approvers:
  - GALI PREM SAGAR (@galipremsagar)

URL: #7313
  • Loading branch information
vuule authored Feb 4, 2021
1 parent fb33b94 commit 3a52d93
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions python/cudf/cudf/tests/test_orc.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ def test_orc_reader_gmt_timestamps(datadir):

def test_orc_bool_encode_fail():
np.random.seed(0)
buffer = BytesIO()

# Generate a boolean column longer than a single stripe
fail_df = cudf.DataFrame({"col": gen_rand_series("bool", 600000)})
Expand All @@ -686,16 +687,15 @@ def test_orc_bool_encode_fail():
# Should throw instead of generating a file that is incompatible
# with other readers (see issue #6763)
with pytest.raises(RuntimeError):
fail_df.to_orc("should_throw.orc")
fail_df.to_orc(buffer)

# Generate a boolean column that fits into a single stripe
okay_df = cudf.DataFrame({"col": gen_rand_series("bool", 500000)})
okay_df["col"][500000 - 1] = None
fname = "single_stripe.orc"
# Invalid row is in the last row group of the stripe;
# encoding is assumed to be correct
okay_df.to_orc(fname)
okay_df.to_orc(buffer)

# Also validate data
pdf = pa.orc.ORCFile(fname).read().to_pandas()
pdf = pa.orc.ORCFile(buffer).read().to_pandas()
assert_eq(okay_df, pdf)

0 comments on commit 3a52d93

Please sign in to comment.