From edddda5c5905857fd16c42b10d0ddb74d5a92909 Mon Sep 17 00:00:00 2001 From: Ruifeng Zheng Date: Tue, 3 Sep 2024 17:22:13 +0800 Subject: [PATCH] nit --- python/pyspark/pandas/plot/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyspark/pandas/plot/core.py b/python/pyspark/pandas/plot/core.py index 928cec1ae8096..458b1193496b2 100644 --- a/python/pyspark/pandas/plot/core.py +++ b/python/pyspark/pandas/plot/core.py @@ -184,7 +184,7 @@ def compute_hist(psdf, bins): # refers to org.apache.spark.ml.feature.Bucketizer#binarySearchForBuckets def binary_search_for_buckets(value: Column): index = SF.binary_search(F.lit(bins), value) - bucket = F.when(index >= F.lit(0), index).otherwise(-index - F.lit(2)) + bucket = F.when(index >= 0, index).otherwise(-index - 2) unboundErrMsg = F.lit(f"value %s out of the bins bounds: [{bins[0]}, {bins[-1]}]") return ( F.when(value == F.lit(bins[-1]), F.lit(len(bins) - 2))