ueshin commented on code in PR #40203:
URL: https://github.com/apache/spark/pull/40203#discussion_r1119468331


##########
python/pyspark/sql/tests/test_functions.py:
##########
@@ -318,19 +318,29 @@ def test_math_functions(self):
         )
 
     def test_inverse_trig_functions(self):
-        from pyspark.sql import functions
+        df = self.spark.createDataFrame([Row(a=i * 0.2, b=i * -0.2) for i in 
range(10)])
 
-        funs = [
-            (functions.acosh, "ACOSH"),
-            (functions.asinh, "ASINH"),
-            (functions.atanh, "ATANH"),
-        ]
+        def check(trig, inv, y_axis_symmetrical):
+            SQLTestUtils.assert_close(
+                [n * 0.2 for n in range(10)],
+                df.select(inv(trig(df.a))).collect(),
+            )
+            if y_axis_symmetrical:
+                SQLTestUtils.assert_close(
+                    [n * 0.2 for n in range(10)],
+                    df.select(inv(trig(df.b))).collect(),
+                )
+            else:
+                SQLTestUtils.assert_close(
+                    [n * -0.2 for n in range(10)],
+                    df.select(inv(trig(df.b))).collect(),
+                )
 
-        cols = ["a", functions.col("a")]
+        from pyspark.sql import functions
 
-        for f, alias in funs:
-            for c in cols:
-                self.assertIn(f"{alias}(a)", repr(f(c)))

Review Comment:
   The upper case name needs to communicate with server side. Do we still want 
to match this?



-- 
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