Fix typing in to_stacked_array (#5494)
Fix typing in to_stacked_array (#5494)

* str to hashable

* sample_dims sequence to mapping

* unions

* typing corrections in the docstring

* Use Collection

* Clarify typing
markelg/xray,pydata/xarray,markelg/xray,markelg/xray,jhamman/xarray,pydata/xarray,jhamman/xarray,jhamman/xarray,pydata/xarray