Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18556#discussion_r126051332
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/source/libsvm/LibSVMRelation.scala ---
    @@ -89,18 +93,17 @@ private[libsvm] class LibSVMFileFormat extends 
TextBasedFileFormat with DataSour
           files: Seq[FileStatus]): Option[StructType] = {
         val libSVMOptions = new LibSVMOptions(options)
         val numFeatures: Int = libSVMOptions.numFeatures.getOrElse {
    -      // Infers number of features if the user doesn't specify (a valid) 
one.
    -      val dataFiles = files.filterNot(_.getPath.getName startsWith "_")
    -      val path = if (dataFiles.length == 1) {
    -        dataFiles.head.getPath.toUri.toString
    -      } else if (dataFiles.isEmpty) {
    +      if (files.isEmpty) {
             throw new IOException("No input path specified for libsvm data")
    --- End diff --
    
    Actually, that should be right after this function call so probably fine 
:). Yea, but at least using `require` should be shorter.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to