From fb569f8486c0b400ecfeb643c80703b34d03675e Mon Sep 17 00:00:00 2001 From: Dane Pitkin Date: Fri, 4 Aug 2023 12:12:44 -0400 Subject: [PATCH] Fix hypothesis warnings --- python/pyarrow/tests/strategies.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/python/pyarrow/tests/strategies.py b/python/pyarrow/tests/strategies.py index 48f7e5381724a..bb88a4dcb7b2a 100644 --- a/python/pyarrow/tests/strategies.py +++ b/python/pyarrow/tests/strategies.py @@ -182,15 +182,17 @@ def struct_types(draw, item_strategy=primitive_types): def dictionary_types(key_strategy=None, value_strategy=None): - key_strategy = key_strategy or signed_integer_types - value_strategy = value_strategy or st.one_of( - bool_type, - integer_types, - st.sampled_from([pa.float32(), pa.float64()]), - binary_type, - string_type, - fixed_size_binary_type, - ) + if key_strategy is None: + key_strategy = signed_integer_types + if value_strategy is None: + value_strategy = st.one_of( + bool_type, + integer_types, + st.sampled_from([pa.float32(), pa.float64()]), + binary_type, + string_type, + fixed_size_binary_type, + ) return st.builds(pa.dictionary, key_strategy, value_strategy) @@ -368,7 +370,7 @@ def record_batches(draw, type, rows=None, max_fields=None): children = [draw(arrays(field.type, size=rows)) for field in schema] # TODO(kszucs): the names and schema arguments are not consistent with # Table.from_array's arguments - return pa.RecordBatch.from_arrays(children, names=schema) + return pa.RecordBatch.from_arrays(children, schema=schema) @st.composite