Repository: apache/arrow
File: python/pyarrow/tests/strategies.py (Python)

Code before:
            max_int64 // 10**9) - datetime.timedelta(hours=12)
        try:
            offset = ty.tz.split(":")
            offset_hours = int(offset[0])
            offset_min = int(offset[1])
            tz = datetime.timedelta(hours=offset_hours, minutes=offset_min)
        except ValueError:
            tz = zoneinfo.ZoneInfo(ty.tz)
        value = st.datetimes(timezones=st.just(tz), min_value=min_datetime,
                             max_value=max_datetime)
    elif pa.types.is_duration(ty):
        min_int64 = -(2**63)
        max_int64 = 2**63 - 1
        if ty.unit == pa.lib.TimeUnit_SECOND:
            value = st.timedeltas(
                min_value=datetime.timedelta.min,
                max_value=datetime.timedelta.max
            )
        elif ty.unit == pa.lib.TimeUnit_MILLI:
            max_millis = max_int64 // 10**3
            value = st.timedeltas(
                min_value=datetime.timedelta(milliseconds=-max_millis),
                max_value=datetime.timedelta(milliseconds=max_millis)
            )
        elif ty.unit == pa.lib.TimeUnit_MICRO:
            max_micros = max_int64 // 10**6
            value = st.timedeltas(
                min_value=datetime.timedelta(microseconds=-max_micros),
                max_value=datetime.timedelta(microseconds=max_micros)
            )
        else:  # TimeUnit_NANO
            # Empirically tested value
            value = st.timedeltas(
                min_value=datetime.timedelta(days=-96_075),
                max_value=datetime.timedelta(days=96_075)
            )
    elif pa.types.is_interval(ty):
        # Empirically tested value
        value = st.timedeltas(
            min_value=datetime.timedelta(days=-96_075),
            max_value=datetime.timedelta(days=96_075)
        )
    elif pa.types.is_binary(ty) or pa.types.is_large_binary(ty):
        value = st.binary()
    elif pa.types.is_string(ty) or pa.types.is_large_string(ty):
        value = st.text()
    elif pa.types.is_fixed_size_binary(ty):
        value = st.binary(min_size=ty.byte_width, max_size=ty.byte_width)
    elif pa.types.is_list(ty):
        value = _pylist(ty.value_type, size=size, nullable=nullable)
    elif pa.types.is_large_list(ty):

Review comment (suggestion):
Seems like we're using nano part always `interval_types = st.just(pa.month_day_nano_interval())` at L146

Code after:
            max_int64 // 10**9) - datetime.timedelta(hours=12)
        try:
            offset = ty.tz.split(":")
            offset_hours = int(offset[0])
            offset_min = int(offset[1])
            tz = datetime.timedelta(hours=offset_hours, minutes=offset_min)
        except ValueError:
            tz = zoneinfo.ZoneInfo(ty.tz)
        value = st.datetimes(timezones=st.just(tz), min_value=min_datetime,
                             max_value=max_datetime)
    elif pa.types.is_duration(ty):
        if ty.unit in ('s', 'ms'):
            min_value = datetime.timedelta.min
            max_value = datetime.timedelta.max
        elif ty.unit == 'us':
            max_int64 = 2**63 - 1
            max_days = max_int64 // (86400 * 10**6)
            min_value = datetime.timedelta(days=-max_days)
            max_value = datetime.timedelta(days=max_days)
        else:  # 'ns'
            # Empirically tested value
            min_value = datetime.timedelta(days=-96_075)
            max_value = datetime.timedelta(days=96_075)
        value = st.timedeltas(min_value=min_value, max_value=max_value)
    elif pa.types.is_interval(ty):
        # Empirically tested value
        value = st.timedeltas(
            min_value=datetime.timedelta(days=-96_075),
            max_value=datetime.timedelta(days=96_075)
        )
    elif pa.types.is_binary(ty) or pa.types.is_large_binary(ty):
        value = st.binary()
    elif pa.types.is_string(ty) or pa.types.is_large_string(ty):
        value = st.text()
    elif pa.types.is_fixed_size_binary(ty):
        value = st.binary(min_size=ty.byte_width, max_size=ty.byte_width)
    elif pa.types.is_list(ty):
        value = _pylist(ty.value_type, size=size, nullable=nullable)
    elif pa.types.is_large_list(ty):
        value = _pylist(ty.value_type, size=size, nullable=nullable)
    elif pa.types.is_fixed_size_list(ty):
        value = _pylist(ty.value_type, size=ty.list_size, nullable=nullable)
    elif pa.types.is_list_view(ty):
        value = _pylist(ty.value_type, size=size, nullable=nullable)
    elif pa.types.is_large_list_view(ty):
        value = _pylist(ty.value_type, size=size, nullable=nullable)
    elif pa.types.is_dictionary(ty):
        values = _pylist(ty.value_type, size=size, nullable=nullable)
        return pa.array(draw(values), type=ty)
    elif pa.types.is_map(ty):
        value = _pymap(ty.key_type, ty.item_type, size=_default_array_sizes,