From dff4a4760949957d7417588251f8f769ed5fdb59 Mon Sep 17 00:00:00 2001 From: Chris Nivera Date: Mon, 30 Sep 2024 16:10:14 -0700 Subject: [PATCH] strip comment --- admin_apps/journeys/iteration.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/admin_apps/journeys/iteration.py b/admin_apps/journeys/iteration.py index 99fa9f09..aca66942 100644 --- a/admin_apps/journeys/iteration.py +++ b/admin_apps/journeys/iteration.py @@ -206,7 +206,10 @@ def edit_verified_query( disabled=not st.session_state.get("successful_sql", False), ) if save: - add_verified_query(question, user_updated_sql) + sql_no_analyst_comment = user_updated_sql.replace( + " /* Generated by Cortex Analyst */", "" + ) + add_verified_query(question, sql_no_analyst_comment) st.session_state["editing"] = False st.session_state["confirmed_edits"] = True @@ -276,7 +279,11 @@ def display_content( key=f"save_idx_{message_index}", use_container_width=True, ): - add_verified_query(question, remove_ltable_cte(sql)) + sql_no_cte = remove_ltable_cte(sql) + cleaned_sql = sql_no_cte.replace( + " /* Generated by Cortex Analyst */", "" + ) + add_verified_query(question, cleaned_sql) if left.button( "Edit",