Closed
Description
An input check has been added in _binary_tree.pxi
scikit-learn/sklearn/neighbors/_binary_tree.pxi
Line 1052 in 61beb3b
Some other were already there
scikit-learn/sklearn/neighbors/_binary_tree.pxi
Line 1335 in 61beb3b
scikit-learn/sklearn/neighbors/_binary_tree.pxi
Line 1472 in 61beb3b
...
The context manager should be used to wrap the calls to BallTree from other classes in scikit-learn that have already validated there input data to avoid duplicating this check (see #18727 for a similar procedure).