This is an automated email from the ASF dual-hosted git repository.

srowen pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
     new 2749043  [MINOR][ML] Fix confusing error message in VectorAssembler
2749043 is described below

commit 2749043f65b37f99696489dede5f6b6b72303085
Author: Tigran Saluev <tig...@saluev.com>
AuthorDate: Thu Feb 27 11:05:53 2020 -0600

    [MINOR][ML] Fix confusing error message in VectorAssembler
    
    ### What changes were proposed in this pull request?
    
    When VectorAssembler encounters a NULL with handleInvalid="error", it 
throws an exception. This exception, though, has a typo making it confusing. 
Yet apparently, this same exception for NaN values is fine. Fixed it to look 
like the right one.
    
    ### Why are the changes needed?
    
    Encountering this error with such message was very confusing! I hope to 
save time of fellow engineers by improving it.
    
    ### Does this PR introduce any user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    It's just an error message...
    
    Closes #27709 from Saluev/patch-1.
    
    Authored-by: Tigran Saluev <tig...@saluev.com>
    Signed-off-by: Sean Owen <sro...@gmail.com>
    (cherry picked from commit 6f4a2e4c99dadf111e43c6e5b4d7ee5e4d4bd8f6)
    Signed-off-by: Sean Owen <sro...@gmail.com>
---
 mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala 
b/mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala
index 57e23d5..9192e72 100644
--- a/mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala
+++ b/mllib/src/main/scala/org/apache/spark/ml/feature/VectorAssembler.scala
@@ -285,7 +285,7 @@ object VectorAssembler extends 
DefaultParamsReadable[VectorAssembler] {
           featureIndex += length
         } else {
           throw new SparkException(
-            s"""Encountered null while assembling a row with handleInvalid = 
"keep". Consider
+            s"""Encountered null while assembling a row with handleInvalid = 
"error". Consider
                |removing nulls from dataset or using handleInvalid = "keep" or 
"skip"."""
               .stripMargin)
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to