@@ -377,3 +377,23 @@ def test_auto_combine_no_concat(self):
377
377
data = Dataset ({'x' : 0 })
378
378
actual = auto_combine ([data , data , data ], concat_dim = None )
379
379
assert_identical (data , actual )
380
+
381
+ # Single object, with a concat_dim explicitly provided
382
+ # Test the issue reported in GH #1988
383
+ objs = [Dataset ({'x' : 0 , 'y' : 1 })]
384
+ dim = DataArray ([100 ], name = 'baz' , dims = 'baz' )
385
+ actual = auto_combine (objs , concat_dim = dim )
386
+ expected = Dataset ({'x' : ('baz' , [0 ]), 'y' : ('baz' , [1 ])},
387
+ {'baz' : [100 ]})
388
+ assert_identical (expected , actual )
389
+
390
+ # Just making sure that auto_combine is doing what is
391
+ # expected for non-scalar values, too.
392
+ objs = [Dataset ({'x' : ('z' , [0 , 1 ]), 'y' : ('z' , [1 , 2 ])})]
393
+ dim = DataArray ([100 ], name = 'baz' , dims = 'baz' )
394
+ actual = auto_combine (objs , concat_dim = dim )
395
+ expected = Dataset ({'x' : (('baz' , 'z' ), [[0 , 1 ]]),
396
+ 'y' : (('baz' , 'z' ), [[1 , 2 ]])},
397
+ {'baz' : [100 ]})
398
+ assert_identical (expected , actual )
399
+
0 commit comments