fixed bugs wrt sp groupbys, insert multiple values

This commit is contained in:
2022-10-26 05:37:49 +08:00
parent 6ad9ba6ea3
commit 31d823ac89
8 changed files with 150 additions and 28 deletions
+10
View File
@@ -148,3 +148,13 @@ def clamp(val, minval, maxval):
def escape_qoutes(string : str):
return re.sub(r'^\'', r'\'',re.sub(r'([^\\])\'', r'\1\'', string))
def get_innermost(sl):
if sl and type(sl) is dict:
if 'literal' in sl and type(sl['literal']) is str:
return f"'{get_innermost(sl['literal'])}'"
return get_innermost(next(iter(sl.values()), None))
elif sl and type(sl) is list:
return get_innermost(sl[0])
else:
return sl