Skip to content

Commit d99e7f3

Browse files
committed
Add partition key to state operations
Signed-off-by: Albert Callarisa <[email protected]>
1 parent d993f90 commit d99e7f3

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

dapr_agents/workflow/agentic.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,10 @@ def register_agent(
288288
store_name=store_name,
289289
key=store_key,
290290
value=json.dumps({}),
291-
state_metadata={"contentType": "application/json"},
291+
state_metadata={
292+
"contentType": "application/json",
293+
"partitionKey": store_key,
294+
},
292295
options=StateOptions(
293296
concurrency=Concurrency.first_write,
294297
consistency=Consistency.strong,
@@ -315,7 +318,10 @@ def register_agent(
315318
operation_type=TransactionOperationType.upsert,
316319
)
317320
],
318-
transactional_metadata={"contentType": "application/json"},
321+
transactional_metadata={
322+
"contentType": "application/json",
323+
"partitionKey": store_key,
324+
},
319325
)
320326
except Exception as e:
321327
raise e

0 commit comments

Comments
 (0)