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



##########
File path: python/pyspark/sql/tests/test_functions.py
##########
@@ -157,6 +159,32 @@ def test_inverse_trig_functions(self):
             for c in cols:
                 self.assertIn(f"{alias}(a)", repr(f(c)))
 
+    def test_reciprocal_trig_functions(self):
+        # SPARK-36683: Add new built-in SQL functions: SEC and CSC
+        list = [0.0, math.pi/6, math.pi/4, math.pi/3, math.pi/2,
+                math.pi, 3 * math.pi / 2, 2 * math.pi]
+
+        df = self.spark.createDataFrame(list, types.DoubleType())
+
+        def to_reciprocal_trig(func):
+            return [1.0 / func(i) if func(i) != 0 else math.inf for i in list]
+
+        def get_values(l):

Review comment:
       Sure, I think we can.




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