From 1abf22bf60ed6bea8a08c3ff51ef677154d733de Mon Sep 17 00:00:00 2001 From: Ekin Tiras Date: Wed, 3 Feb 2021 12:47:34 +0100 Subject: [PATCH] Update Method names for Python SDK example The function names for saving, getting and executing transactions with multiple state items were incorrect for v1-rc3 in the current documentation. I have updated them "save_bulk_state", "get_bulk_state" and "execute_state_transaction". --- .../state-management/howto-get-save-state.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md index ce3724515..262e3bc40 100644 --- a/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md +++ b/daprdocs/content/en/developing-applications/building-blocks/state-management/howto-get-save-state.md @@ -273,10 +273,10 @@ with DaprClient() as d: s1 = StateItem(key="key1", value="value1") s2 = StateItem(key="key2", value="value2") - d.save_states(store_name="statestore", states=[s1,s2]) + d.save_bulk_state(store_name="statestore", states=[s1,s2]) print("States have been stored") - items = d.get_states(store_name="statestore", keys=["key1", "key2"]).items + items = d.get_bulk_state(store_name="statestore", keys=["key1", "key2"]).items print(f"Got items: {[i.data for i in items]}") ``` @@ -357,10 +357,10 @@ with DaprClient() as d: s1 = StateItem(key="key1", value="value1") s2 = StateItem(key="key2", value="value2") - d.save_states(store_name="statestore", states=[s1,s2]) + d.save_bulk_state(store_name="statestore", states=[s1,s2]) print("States have been stored") - d.execute_transaction( + d.execute_state_transaction( store_name="statestore", operations=[ TransactionalStateOperation(key="key1", data="newValue1", operation_type=TransactionOperationType.upsert), @@ -369,7 +369,7 @@ with DaprClient() as d: ) print("State transactions have been completed") - items = d.get_states(store_name="statestore", keys=["key1", "key2"]).items + items = d.get_bulk_state(store_name="statestore", keys=["key1", "key2"]).items print(f"Got items: {[i.data for i in items]}") ``` @@ -406,4 +406,4 @@ You're up and running! Both Dapr and your app logs will appear here. - Read the full [State API reference]({{< ref state_api.md >}}) - Try one of the [Dapr SDKs]({{< ref sdks >}}) -- Build a [stateful service]({{< ref howto-stateful-service.md >}}) \ No newline at end of file +- Build a [stateful service]({{< ref howto-stateful-service.md >}})