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

The SparseVector parser fails checking for valid end parenthesis

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.1, 2.0.0
    • Fix Version/s: 1.6.2, 2.0.0
    • Component/s: MLlib, PySpark
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: