Repository: dask/dask

Issue:
bug in dask.array.reshape_blockwise
**Minimal Complete Verifiable Example**:

```python
import dask.array

reshape_blockwise(dask.array.ones((3,)), shape=(3,), chunks=((3,),))
```
```
ValueError: Setting chunks is not allowed when reducing the number of dimensions.
```

cc @phofl 


Discussion:
github-actions[bot]: ## Unit Test Results
_See [test report](https://dask.github.io/dask/test_report.html) for an extended history of previous test failures. This is useful for diagnosing flaky tests._

     13 files  ± 0       13 suites  ±0   3h 23m 5s ⏱️ + 1m 17s
 13 296 tests  -  1   12 234 ✅  - 1   1 062 💤 ±0  0 ❌ ±0 
138 767 runs   - 11  119 776 ✅  - 9  18 991 💤  - 2  0 ❌ ±0 

Results for commit c366854b. ± Comparison against base commit 5b115c43.

<details>
  <summary>This pull request <b>removes</b> 2 and <b>adds</b> 1 tests. <i>Note that renamed tests count towards both.</i></summary>

```
dask.array.tests.test_reshape ‑ test_reshape_blockwise_dimension_reduction_and_chunks[shape0]
dask.array.tests.test_reshape ‑ test_reshape_blockwise_dimension_reduction_and_chunks[shape1]
```

```
dask.array.tests.test_reshape ‑ test_reshape_blockwise_dimension_reduction_and_chunks
```
</details>

[test-results]:data:application/gzip;base64,H4sIAF+wPWcC/03Myw6DIBCF4VcxrLsAVIbpyzQ4QkLqpUFYNX334g1d/t9Mzpc5P9iFPStRPyq2JB+v6lMw0c/T2lLoNlO+xv0uUZ39WhLR9iTr5sK3/6zIlSzmjB+y8QI2hDkcEtK0T2tQcHSZFgigCh7TGlGcdpve+r5M8zj6mINRrZRumw6MJN4jWU694k4SUOckCiDbAlrNfn+BN8NLGgEAAA==


Patch:
diff --git a/dask/array/core.py b/dask/array/core.py
index 10736af6f..0a7ebeb1b 100644
--- a/dask/array/core.py
+++ b/dask/array/core.py
@@ -3754,9 +3754,9 @@ def from_zarr(
                 store = zarr.storage.FSStore(url, **storage_options)
         else:
             store = url
-        z = zarr.open_array(store=store, read_only=True, path=component, **kwargs)
+        z = zarr.open_array(store=store, path=component, **kwargs)
     else:
-        z = zarr.open_array(store=url, read_only=True, path=component, **kwargs)
+        z = zarr.open_array(store=url, path=component, **kwargs)
     chunks = chunks if chunks is not None else z.chunks
     if name is None:
         name = "from-zarr-" + tokenize(z, component, storage_options, chunks, **kwargs)
diff --git a/dask/array/reshape.py b/dask/array/reshape.py
index 1cc79090a..b824110c7 100644
--- a/dask/array/reshape.py
+++ b/dask/array/reshape.py
@@ -473,6 +473,9 @@ def reshape_blockwise(
 
     _sanity_checks(x, shape)
 
+    if len(shape) == x.ndim and shape == x.shape:
+        return Array(x.dask, x.name, x.chunks, meta=x)
+
     outname = "reshape-blockwise-" + tokenize(x, shape)
     chunk_tuples = list(product(*(range(len(c)) for i, c in enumerate(x.chunks))))
 
@@ -515,9 +518,6 @@ def reshape_blockwise(
         x.shape, shape, x.chunks, disallow_dimension_expansion=True
     )
 
-    if len(shape) == x.ndim:
-        return Array(x.dask, x.name, x.chunks, meta=x)
-
     # Convert input chunks to output chunks
     out_shapes = [
         _convert_to_shape(c, mapper_in, one_dimensions)


Test patch:
diff --git a/dask/array/tests/test_reshape.py b/dask/array/tests/test_reshape.py
index 14fb84ba9..1473d97d1 100644
--- a/dask/array/tests/test_reshape.py
+++ b/dask/array/tests/test_reshape.py
@@ -411,12 +411,11 @@ def test_reshape_blockwise_raises_for_expansion():
         reshape_blockwise(arr, (3, 2, 9))
 
 
-@pytest.mark.parametrize("shape", [(18, 3), (6, 3, 3)])
-def test_reshape_blockwise_dimension_reduction_and_chunks(shape):
+def test_reshape_blockwise_dimension_reduction_and_chunks():
     x = np.arange(0, 54).reshape(6, 3, 3)
     arr = from_array(x, chunks=(3, 2, (2, 1)))
     with pytest.raises(ValueError, match="Setting chunks is not allowed when"):
-        reshape_blockwise(arr, shape, arr.chunks)
+        reshape_blockwise(arr, (18, 3), arr.chunks)
 
 
 def test_reshape_blockwise_identity():
@@ -426,6 +425,10 @@ def test_reshape_blockwise_identity():
     assert len(arr.dask) == len(result.dask)
     assert_eq(result, x)
 
+    result = reshape_blockwise(arr, (6, 3, 3), chunks=arr.chunks)
+    assert len(arr.dask) == len(result.dask)
+    assert_eq(result, x)
+
 
 def test_argwhere_reshaping_not_concating_chunks():
     # GH#10080