Skip to content

Commit

Permalink
use snowpark dataframe instead of write_pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-tzayats committed Dec 10, 2024
1 parent 3a3f97f commit a00b526
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions journeys/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,14 @@ def _llm_judge(frame: pd.DataFrame) -> pd.DataFrame:
frame2_str=x["GOLD_RESULT"].to_string(index=False),
),
).to_frame(name=col_name)
conn = get_snowflake_connection()
session = st.session_state["session"]
table_name = snowpark_utils.random_name_for_temp_object(
snowpark_utils.TempObjectType.TABLE
)
_ = write_pandas(
conn=conn,
df=prompt_frame,
table_name=table_name,
auto_create_table=True,
table_type="temporary",
overwrite=True,
conn = get_snowflake_connection()
snowpark_df = session.create_dataframe(prompt_frame)
snowpark_df.write.mode("overwrite").save_as_table(
table_name, table_type="temporary"
)

query = f"""
Expand Down

0 comments on commit a00b526

Please sign in to comment.