This warning is created by sklearn, as it seems that the target array doesn’t contain any negative samples, and thus the metric calculation would be meaningless.
You could check labels and make sure that it contains positive and negative samples.