Skip to content

Commit

Permalink
feat: Updated agents-api/agents_api/models/session
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Apr 13, 2024
1 parent ddd39cc commit 5ebfd60
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions agents-api/agents_api/models/session/update_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ def update_session_query(
developer_id: UUID,
**update_data,
) -> pd.DataFrame:
# Process the update data to prepare it for the query.
session_update_cols, session_update_vals = cozo_process_mutate_data(
{
**{k: v for k, v in update_data.items() if v is not None},
}
)

# Prepare lists of columns for the query.
session_update_cols_lst = session_update_cols.split(",")
all_fields_lst = list(set(session_update_cols_lst).union(set(_fields)))
all_fields = ", ".join(all_fields_lst)
Expand All @@ -37,6 +39,7 @@ def update_session_query(
)
)

# Construct the datalog query for updating session information.
session_update_query = f"""
{{
input[{session_update_cols}] <- $session_update_vals
Expand Down

0 comments on commit 5ebfd60

Please sign in to comment.