You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by HyukjinKwon <gi...@git.apache.org> on 2018/08/16 06:37:13 UTC

[GitHub] spark pull request #20725: [SPARK-23555][PYTHON] Add BinaryType support for ...

Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20725#discussion_r210489614
  
    --- Diff: python/pyspark/sql/tests.py ---
    @@ -4331,13 +4354,22 @@ def test_createDataFrame_fallback_enabled(self):
                         self.assertEqual(df.collect(), [Row(a={u'a': 1})])
     
         def test_createDataFrame_fallback_disabled(self):
    +        from distutils.version import LooseVersion
             import pandas as pd
    +        import pyarrow as pa
     
             with QuietTest(self.sc):
                 with self.assertRaisesRegexp(TypeError, 'Unsupported type'):
                     self.spark.createDataFrame(
                         pd.DataFrame([[{u'a': 1}]]), "a: map<string, int>")
     
    +        # TODO: remove BinaryType check once minimum pyarrow version is 0.10.0
    +        if LooseVersion(pa.__version__) < LooseVersion("0.10.0"):
    +            with QuietTest(self.sc):
    +                with self.assertRaisesRegexp(TypeError, 'Unsupported type.*BinaryType'):
    +                    self.spark.createDataFrame(
    +                        pd.DataFrame([[{'a': b'aaa'}]]), "a: binary")
    --- End diff --
    
    @BryanCutler, BTW, what kind of data can be binary? `bytearray` and `byte` (`str` in Python 2)?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org