Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
  • Loading branch information
raulcd and pitrou authored Aug 6, 2024
1 parent ff49c27 commit ff413f5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion python/pyarrow/tests/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ def split_columns(arr, num_cols, num_rows):


def make_random_csv(num_cols=2, num_rows=10, linesep='\r\n', write_names=True):
arr = [random.randint(0, 1000) for _ in range(num_cols * num_rows)]
rnd = random.Random(42)
arr = [rnd.randint(0, 1000) for _ in range(num_cols * num_rows)]
csv = io.StringIO()
col_names = list(itertools.islice(generate_col_names(), num_cols))
if write_names:
Expand Down
4 changes: 2 additions & 2 deletions python/pyarrow/tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -1264,10 +1264,10 @@ def test_field_modified_copies():
assert f0.equals(f0_)


@pytest.mark.numpy
def test_is_integer_value():
assert pa.types.is_integer_value(1)
assert pa.types.is_integer_value(np.int64(1))
if np is not None:
assert pa.types.is_integer_value(np.int64(1))
assert not pa.types.is_integer_value('1')


Expand Down
3 changes: 1 addition & 2 deletions python/pyarrow/tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,7 @@ def randdecimal(precision, scale):


def random_ascii(length):
import numpy as np
return bytes(np.random.randint(65, 123, size=length, dtype='i1'))
return bytes([random.randint(65, 122) for i in range(length)])


def rands(nchars):
Expand Down

0 comments on commit ff413f5

Please sign in to comment.