Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-16035

The SparseVector parser fails checking for valid end parenthesis

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.6.1, 2.0.0
    • 1.6.2, 2.0.0
    • MLlib, PySpark
    • None

    Description

      Running
      SparseVector.parse(' (4, [0,1 ],[ 4.0,5.0] ')
      will not raise an exception as expected, although it parses it as if there was an end parenthesis.

      This can be fixed by replacing

      if start == -1:
      raise ValueError("Tuple should end with ')'")

      with
      if end == -1:
      raise ValueError("Tuple should end with ')'")

      Please see posted PR

      Attachments

        Activity

          People

            andreapasqua Andrea Pasqua
            andreapasqua Andrea Pasqua
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: