Created
January 31, 2019 14:48
-
-
Save afranzi/e70ab96cbd81de1566aa744879eda5ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
from our_package import to_upper | |
class TestUDFs(TestCase): | |
def test_upper(self): | |
""" | |
# Case 1 - Lambda | |
to_upper = udf(lambda s: s.upper() if s else None, StringType()) | |
""" | |
self.assertEqual(to_upper('potato'), 'POTATO') | |
self.assertEqual(to_upper(None), None) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment