Skip to content

Commit

Permalink
Fix hypothesis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
danepitkin committed Aug 4, 2023
1 parent 6db95f6 commit fb569f8
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions python/pyarrow/tests/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fb569f8

Please sign in to comment.