(num_cols=2, num_rows=10, linesep='\r\n')
| 44 | |
| 45 | |
| 46 | def make_random_json(num_cols=2, num_rows=10, linesep='\r\n'): |
| 47 | arr = np.random.RandomState(42).randint(0, 1000, size=(num_cols, num_rows)) |
| 48 | col_names = list(itertools.islice(generate_col_names(), num_cols)) |
| 49 | lines = [] |
| 50 | for row in arr.T: |
| 51 | json_obj = OrderedDict([(k, int(v)) for (k, v) in zip(col_names, row)]) |
| 52 | lines.append(json.dumps(json_obj)) |
| 53 | data = linesep.join(lines).encode() |
| 54 | columns = [pa.array(col, type=pa.int64()) for col in arr] |
| 55 | expected = pa.Table.from_arrays(columns, col_names) |
| 56 | return data, expected |
| 57 | |
| 58 | |
| 59 | def check_options_class_pickling(cls, pickler, **attr_values): |
no test coverage detected