Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengruifeng committed Sep 3, 2024
1 parent 6d4e695 commit edddda5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/pyspark/pandas/plot/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit edddda5

Please sign in to comment.