I think it should be possible to support sparse data when `metric != 'precomputed'` as long as `sklearn.metrics.pairwise_distances(X, metric=self.metric, squared=True)` supports it. Can you please try to relax the check and write a test for this case (e.g. using a `csr_matrix`)?