Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1import hashlib 

2 

3from sdc_etl_libs.sdc_dataframe.udfs.pandas.PandasUDF import PandasUDF 

4 

5 

6class MD5HashRowPandasUDF(PandasUDF): 

7 

8 def apply_udf(row_, **opts_): 

9 """ Returns a md5 hash value 

10 param: row_ of a dataframe 

11 type: row_: Pandas Series() 

12 param: opts_: is empty 

13 type: opts: dict 

14 return: str 

15 """ 

16 return hashlib.md5(str(tuple(row_)).encode()).hexdigest() #nosec