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

    https://github.com/apache/spark/pull/18926#discussion_r133180053
  
    --- Diff: python/pyspark/sql/tests.py ---
    @@ -1220,6 +1220,13 @@ def test_rand_functions(self):
             rndn2 = df.select('key', functions.randn(0)).collect()
             self.assertEqual(sorted(rndn1), sorted(rndn2))
     
    +    def test_string_functions(self):
    +        from pyspark.sql.functions import col, lit
    +        df = self.spark.createDataFrame([['nick']], schema=['name'])
    +        self.assertRaises(TypeError, lambda: 
df.select(col('name').substr(0, lit(1))))
    --- End diff --
    
    I was considering doing that at first, but it felt like just duplicating 
logic. Looking through the other uses of `assertRaisesRegexp()`, it looks like 
most of the time we just search for a keyword, but there are also some 
instances where a large part of the exception message is checked. I can do that 
here as well.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to