Github user HyukjinKwon commented on a diff in the pull request:
    --- Diff: python/pyspark/sql/ ---
    @@ -1923,6 +1923,9 @@ def toPandas(self):
             0    2  Alice
             1    5    Bob
    +        from pyspark.sql.utils import require_minimum_pandas_version
    --- End diff --
    `toPandas` seems already failed when it includes types `TimestampType`:
    >>> import datetime
    >>> spark.createDataFrame([[]]).toPandas()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/.../spark/python/pyspark/sql/", line 1978, in toPandas
        _check_series_convert_timestamps_local_tz(pdf[], timezone)
      File "/.../spark/python/pyspark/sql/", line 1775, in 
        return _check_series_convert_timestamps_localize(s, None, timezone)
      File "/.../spark/python/pyspark/sql/", line 1750, in 
      File "/.../spark/python/pyspark/sql/", line 128, in 
        "your version was %s." % (minimum_pandas_version, pandas.__version__))
    ImportError: Pandas >= 0.19.2 must be installed; however, your version was 
    Since we set the supported version, I think we should better explicitly 
require the version. Let me know if anyone thinks differently ..


To unsubscribe, e-mail:
For additional commands, e-mail:

Reply via email to