you can use concat_ws for this
@@ -41,20 +41,6 @@ def sql_gen_comparison_columns(columns:list) -> str:
return ", ".join(flat_list)
-def sql_gen_concat_cols(cols, delimiter=" "):
- """
- Generate a sql expression to concatenate multiple columns
- together using a delimiter
- e.g. ["a", "b", "c"]
- => concat(coalesce(a, ""), " ", coalesce(b, ""), " ", coalesce(c, ""))
- """
-
- surrounded = [f'coalesce({name}, "")' for name in cols]
- with_spaces = f', "{delimiter}", '.join(surrounded)
-
- return f'concat({with_spaces})'
-
-
def blank_strings_to_nulls(df, columns):
"""
turn blank strings into columns
