@@ -608,11 +608,11 @@ def test_to_dataset_roundtrip(self):
608608 v = self .lazy_array
609609
610610 expected = u .assign_coords (x = u ["x" ])
611- self .assertLazyAndEqual (expected , v .to_dataset ("x" ).to_array ("x" ))
611+ self .assertLazyAndEqual (expected , v .to_dataset ("x" ).to_dataarray ("x" ))
612612
613613 def test_merge (self ):
614614 def duplicate_and_merge (array ):
615- return xr .merge ([array , array .rename ("bar" )]).to_array ()
615+ return xr .merge ([array , array .rename ("bar" )]).to_dataarray ()
616616
617617 expected = duplicate_and_merge (self .eager_array )
618618 actual = duplicate_and_merge (self .lazy_array )
@@ -1306,12 +1306,12 @@ def test_map_blocks_kwargs(obj):
13061306 assert_identical (actual , expected )
13071307
13081308
1309- def test_map_blocks_to_array (map_ds ):
1309+ def test_map_blocks_to_dataarray (map_ds ):
13101310 with raise_if_dask_computes ():
1311- actual = xr .map_blocks (lambda x : x .to_array (), map_ds )
1311+ actual = xr .map_blocks (lambda x : x .to_dataarray (), map_ds )
13121312
1313- # to_array does not preserve name, so cannot use assert_identical
1314- assert_equal (actual , map_ds .to_array ())
1313+ # to_dataarray does not preserve name, so cannot use assert_identical
1314+ assert_equal (actual , map_ds .to_dataarray ())
13151315
13161316
13171317@pytest .mark .parametrize (
@@ -1376,8 +1376,8 @@ def test_map_blocks_template_convert_object():
13761376 assert_identical (actual , template )
13771377
13781378 ds = da .to_dataset ()
1379- func = lambda x : x .to_array ().isel (x = [1 ])
1380- template = ds .to_array ().isel (x = [1 , 5 , 9 ])
1379+ func = lambda x : x .to_dataarray ().isel (x = [1 ])
1380+ template = ds .to_dataarray ().isel (x = [1 , 5 , 9 ])
13811381 with raise_if_dask_computes ():
13821382 actual = xr .map_blocks (func , ds , template = template )
13831383 assert_identical (actual , template )
0 commit comments