HyukjinKwon commented on a change in pull request #33992:
URL: https://github.com/apache/spark/pull/33992#discussion_r708052662



##########
File path: python/pyspark/sql/tests/test_functions.py
##########
@@ -197,6 +197,18 @@ def test_string_functions(self):
                 df.select(getattr(functions, name)("name")).first()[0],
                 df.select(getattr(functions, name)(col("name"))).first()[0])
 
+    def test_octet_length_function(self):
+        from pyspark.sql.functions import octet_length
+        df = self.spark.createDataFrame([('cat',), ('\U0001F408',)], ['cat'])
+        actual = df.select(octet_length('cat')).collect()
+        self.assertEqual([Row(3), Row(4)], actual)
+
+    def test_bit_length_function(self):
+        from pyspark.sql.functions import bit_length

Review comment:
       I know this is sort of consistent with other tests but in fact it's 
totally fine to import it on the top. Since this is a new feature that's not 
going to be backported, let's move this import to the top.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to