Skip to content

[Bug] Passing in Throughput Object with offer_throughput #39937

Open
@tvaron3

Description

@tvaron3

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

ClientThis issue points to a problem in the data-plane of the library.CosmosService AttentionWorkflow: This issue is responsible by Azure service team.

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions