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

    https://github.com/apache/spark/pull/13778#discussion_r67894162
  
    --- Diff: python/pyspark/sql/tests.py ---
    @@ -558,6 +558,18 @@ def check_datatype(datatype):
             _verify_type(PythonOnlyPoint(1.0, 2.0), PythonOnlyUDT())
             self.assertRaises(ValueError, lambda: _verify_type([1.0, 2.0], 
PythonOnlyUDT()))
     
    +        schema = StructType().add("key", LongType()).add("val", 
PythonOnlyUDT())
    +        df = self.spark.createDataFrame(
    +            [(i % 3, PythonOnlyPoint(float(i), float(i))) for i in 
range(10)],
    +            schema=schema)
    +        df.show()
    --- End diff --
    
    `DataFrame.show()` gives unnecessary stringification, so this test ends up 
testing unnecessary stuff (in fact it would fail if the UDT didn't have 
`__str__`. I would use `collect()` to force materialization instead.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to