https://github.com/pydata/xarray/blob/master/xarray/core/dataset.py#L4085
Should that be called coord or dim? Currently there's a variable that's undefined:
raise ValueError('Coordinate {} does not exist.'.format(dim))
I would have made a quick fix but not sure the correct name