title: Spark 2.0 toPandas method
body: <p>I have a spark data frame like below:</p>
  
  <pre><code>topics.show(2)
  +-----+--------------------+--------------------+--------------------+
  |topic|         termIndices|         termWeights|        topics_words|
  +-----+--------------------+--------------------+--------------------+
  |    0|[0, 39, 68, 43, 5...|[0.06362107696025...|[, management, sa...|
  |    1|[3, 1, 8, 6, 4, 1...|[0.03164821806301...|[objectives, lear...|
  +-----+--------------------+--------------------+--------------------+
  only showing top 2 rows
  </code></pre>
  
  <p>However when I try to convert to pandas data frame using below method which works in 1.6, I get an error.</p>
  
  <pre><code>topics.toPandas()
  
  ---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-165-4c1231b68769&gt; in &lt;module&gt;()
  ----&gt; 1 topics.toPandas()
  
  /Users/i854319/spark2/python/pyspark/sql/dataframe.pyc in toPandas(self)
     1440         """
     1441         import pandas as pd
  -&gt; 1442         return pd.DataFrame.from_records(self.collect(), columns=self.columns)
     1443 
     1444     ##########################################################################################
  
  /Users/i854319/spark2/python/pyspark/sql/dataframe.pyc in collect(self)
      307         [Row(age=2, name=u'Alice'), Row(age=5, name=u'Bob')]
      308         """
  --&gt; 309         with SCCallSiteSync(self._sc) as css:
      310             port = self._jdf.collectToPython()
      311         return list(_load_from_socket(port, BatchedSerializer(PickleSerializer())))
  
  /Users/i854319/spark2/python/pyspark/traceback_utils.pyc in __enter__(self)
       70     def __enter__(self):
       71         if SCCallSiteSync._spark_stack_depth == 0:
  ---&gt; 72             self._context._jsc.setCallSite(self._call_site)
       73         SCCallSiteSync._spark_stack_depth += 1
       74 
  
  AttributeError: 'NoneType' object has no attribute 'setCallSite'
  </code></pre>
  
  <p>So not sure if there is a bug in this method in Spark 2.0.2 or something is going wrong? </p>