Skip to content

Commit

Permalink
Fix LongGen accidentally using special cases when none are desired
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Lowe <[email protected]>
  • Loading branch information
jlowe committed Dec 5, 2023
1 parent 0b14410 commit ad8eab3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions integration_tests/src/main/python/data_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad8eab3

Please sign in to comment.