Open
Description
The following code snippet does not work. The throughput object currently only works for auto scale. For manual throughput passing in an int is the only option. The logic for parsing the auto scale properties should also be reviewed again.
collection = db_fixture.get_collection(client.get_database_client(DB_NAME), collection_name)
# get current collection throughput settings
current_throughput = collection.get_throughput()
print("Current throughput: ", current_throughput.offer_throughput)
new_throughput = ThroughputProperties(offer_throughput=2500)
update_throughput = collection.replace_throughput(new_throughput)
retrieve_throughput = collection.get_throughput()
assert getattr(retrieve_throughput, "offer_throughput") == getattr(new_throughput, "offer_throughput")
The behavior for the code above should be the same as the one below.
collection = db_fixture.get_collection(client.get_database_client(DB_NAME), collection_name)
# get current collection throughput settings
current_throughput = collection.get_throughput()
print("Current throughput: ", current_throughput.offer_throughput)
new_throughput = ThroughputProperties(offer_throughput=2500)
update_throughput = collection.replace_throughput(new_throughput.offer_throughput)
retrieve_throughput = collection.get_throughput()
assert getattr(retrieve_throughput, "offer_throughput") == getattr(new_throughput, "offer_throughput")
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status