mirror of https://github.com/dapr/docs.git
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".
This commit is contained in:
parent
df05ea3596
commit
1abf22bf60
|
@ -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 >}})
|
||||
- Build a [stateful service]({{< ref howto-stateful-service.md >}})
|
||||
|
|
Loading…
Reference in New Issue