I think we should explicitly set the shape of the matrix, e.g.:

```python
matrix = csc_matrix(cs, shape=shape) if order == 'sample' else ...
```