MCPcopy Create free account
hub / github.com/apache/arrow / check

Method check

python/pyarrow/tests/test_pandas.py:2862–2880  ·  view source on GitHub ↗
(arr, data, mask=None)

Source from the content-addressed store, hash-verified

2860 yield from chunk
2861
2862 def check(arr, data, mask=None):
2863 assert len(arr) == len(data)
2864 xs = data['x']
2865 ys = data['y']
2866 for i, obj in enumerate(iter_chunked_array(arr)):
2867 try:
2868 d = obj.as_py()
2869 if mask is not None and mask[i]:
2870 assert d is None
2871 else:
2872 x = xs[i]
2873 if np.isnan(x):
2874 assert d['x'] is None
2875 else:
2876 assert d['x'] == x
2877 assert d['y'] == ys[i]
2878 except Exception:
2879 print("Failed at index", i)
2880 raise
2881
2882 check(arr, data)
2883 del arr

Callers

nothing calls this directly

Calls 2

lenFunction · 0.85
as_pyMethod · 0.80

Tested by

no test coverage detected