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

Python profile, show_profiles() and dump_profiles(), should throw an error with a better message

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.1.2, 2.2.1, 2.3.0
    • Component/s: PySpark
    • Labels:
      None

      Description

      I mistakenly missed spark.python.profile enabled today while profiling and met this unfriendly messages:

      >>> sc.show_profiles()
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File ".../spark/python/pyspark/context.py", line 1000, in show_profiles
          self.profiler_collector.show_profiles()
      AttributeError: 'NoneType' object has no attribute 'show_profiles'
      >>> sc.dump_profiles("/tmp/abc")
      Traceback (most recent call last):
        File "<stdin>", line 1, in <module>
        File ".../spark/python/pyspark/context.py", line 1005, in dump_profiles
          self.profiler_collector.dump_profiles(path)
      AttributeError: 'NoneType' object has no attribute 'dump_profiles'
      

      It looks we should give better information that says spark.python.profile should be enabled.

        Attachments

          Activity

            People

            • Assignee:
              hyukjin.kwon Hyukjin Kwon
              Reporter:
              hyukjin.kwon Hyukjin Kwon
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: