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 problems with nulls in sequence tests #9865

Merged
merged 1 commit into from
Nov 28, 2023
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
6 changes: 4 additions & 2 deletions integration_tests/src/main/python/collection_ops_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ def test_sequence_with_step(start_gen, stop_gen, step_gen):
# Get a step scalar from the 'step_gen' which follows the rules.
step_gen.start(random.Random(data_gen_seed))
step_lit = step_gen.gen()
if step_lit is None:
step_lit = "null"
assert_gpu_and_cpu_are_equal_collect(
lambda spark: three_col_df(spark, start_gen, stop_gen, step_gen).selectExpr(
"sequence(a, b, c)",
Expand Down Expand Up @@ -327,8 +329,8 @@ def test_sequence_illegal_boundaries(start_gen, stop_gen, step_gen):
# Exceed the max length of a sequence
# "Too long sequence: xxxxxxxxxx. Should be <= 2147483632"
sequence_too_long_length_gens = [
IntegerGen(min_val=2147483633, max_val=2147483633, special_cases=[]),
LongGen(min_val=2147483635, max_val=2147483635, special_cases=[None])
IntegerGen(min_val=2147483633, max_val=2147483633, special_cases=[], nullable=False),
LongGen(min_val=2147483635, max_val=2147483635, special_cases=[], nullable=False)
]

@pytest.mark.parametrize('stop_gen', sequence_too_long_length_gens, ids=idfn)
Expand Down