Python Remove Text After Substring Function In Sql