diff options
author | Eric Wieser <wieser.eric@gmail.com> | 2017-06-27 18:49:47 +0100 |
---|---|---|
committer | Eric Wieser <wieser.eric@gmail.com> | 2017-06-27 18:49:47 +0100 |
commit | 64b0e54ce6ebf6bb16b9305f4d7f22b943c26b84 (patch) | |
tree | 3ec08077b61a9a8ece2eccadfcedf8b2d8443e6f /numpy/lib/tests/test_recfunctions.py | |
parent | 3600068426bfc86c1ccfa85a53394c6f6164a96f (diff) | |
download | numpy-64b0e54ce6ebf6bb16b9305f4d7f22b943c26b84.tar.gz |
TST: Verify that join_by doesn't choke on subdtypes
Diffstat (limited to 'numpy/lib/tests/test_recfunctions.py')
-rw-r--r-- | numpy/lib/tests/test_recfunctions.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_recfunctions.py b/numpy/lib/tests/test_recfunctions.py index 0940d37b0..e9cfa4993 100644 --- a/numpy/lib/tests/test_recfunctions.py +++ b/numpy/lib/tests/test_recfunctions.py @@ -588,6 +588,16 @@ class TestJoinBy(TestCase): dtype=[('a', int), ('b', int), ('c', int), ('d', int)]) + def test_join_subdtype(self): + # tests the bug in https://stackoverflow.com/q/44769632/102441 + from numpy.lib import recfunctions as rfn + foo = np.array([(1,)], + dtype=[('key', int)]) + bar = np.array([(1, np.array([1,2,3]))], + dtype=[('key', int), ('value', 'uint16', 3)]) + res = join_by('key', foo, bar) + assert_equal(res, bar.view(ma.MaskedArray)) + def test_outer_join(self): a, b = self.a, self.b |