Skip to content

Commit a6adbf2

Browse files
authored
Update scala_utils.py to handle empty strings in java_list_to_python_list (#11)
* Update scala_utils.py "handle empty values in scala_utils.py->java_list_to_python_list" * Update scala_utils.py
1 parent 4f57544 commit a6adbf2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pydeequ/scala_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ def java_list_to_python_list(java_list:str, datatype):
9898
# Currently turn the java object into a string and pass it through
9999
start = java_list.index('(')
100100
end = java_list.index(')')
101-
vals = [datatype(i) for i in java_list[start+1:end].split(',')]
101+
empty_val = '' if datatype == str else None
102+
vals = [datatype(i) if i !='' else empty_val for i in java_list[start+1:end].split(',')]
102103
return vals
103104

104-
# TODO Tuple => Python Tuple
105+
# TODO Tuple => Python Tuple

0 commit comments

Comments
 (0)