Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix failing CI ORC test #7313

Merged
merged 2 commits into from
Feb 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)