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

'Index' object has no attribute 'levels' in pyspark.pandas.frame.DataFrame.insert

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.0
    • 3.3.0
    • PySpark
    • None

    Description

       This piece of code in pyspark.pandas.frame is going to fail on runtime, when is_name_like_tuple evaluates to True

      if is_name_like_tuple(column):
          if len(column) != len(self.columns.levels):
      

      with

      'Index' object has no attribute 'levels'
      

      To be honest, I am not sure what is intended behavior (initially, I suspected that we should have

       if len(column) != self.columns.nlevels
      

      but nlevels is hard-coded to one, and wouldn't be consistent with Pandas at all.

      Attachments

        Activity

          People

            itholic Haejoon Lee
            zero323 Maciej Szymkiewicz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: