Github user jkbradley commented on a diff in the pull request: https://github.com/apache/spark/pull/17532#discussion_r109975956 --- Diff: python/pyspark/ml/linalg/__init__.py --- @@ -72,7 +72,9 @@ def _convert_to_vector(l): return DenseVector(l) elif _have_scipy and scipy.sparse.issparse(l): assert l.shape[1] == 1, "Expected column vector" - csc = l.tocsc() + # Make sure the converted csc_matrix has sorted indices. + csc = l.tocsr().tocsc() --- End diff -- I'd just call tocsc. You can then check the attribute has_sorted_indices and call sort_indices() if needed.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org