the resulting comment is looking nothing like it does in edit mode

this is the function

def to_datetime_(col, format): 
# Spark 2.2 or later syntax, for < 2.2 use unix_timestamp and cast 
    return coalesce(to_date(col, format))