From ad8eab3d618deea533d1ecc41e300d569bcd9671 Mon Sep 17 00:00:00 2001 From: Jason Lowe Date: Tue, 5 Dec 2023 09:19:22 -0600 Subject: [PATCH] Fix LongGen accidentally using special cases when none are desired Signed-off-by: Jason Lowe --- integration_tests/src/main/python/data_gen.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/integration_tests/src/main/python/data_gen.py b/integration_tests/src/main/python/data_gen.py index 9aa5e547c45..895e56050cc 100644 --- a/integration_tests/src/main/python/data_gen.py +++ b/integration_tests/src/main/python/data_gen.py @@ -280,10 +280,13 @@ def random_decimal(rand): LONG_MIN = -(1 << 63) LONG_MAX = (1 << 63) - 1 +_MISSING_ARG = object() + class LongGen(DataGen): """Generate Longs, which some built in corner cases.""" - def __init__(self, nullable=True, min_val = LONG_MIN, max_val = LONG_MAX, special_cases = []): - _special_cases = [min_val, max_val, 0, 1, -1] if not special_cases else special_cases + def __init__(self, nullable=True, min_val = LONG_MIN, max_val = LONG_MAX, + special_cases = _MISSING_ARG): + _special_cases = [min_val, max_val, 0, 1, -1] if special_cases is _MISSING_ARG else special_cases super().__init__(LongType(), nullable=nullable, special_cases=_special_cases) self._min_val = min_val self._max_val = max_val