Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] TableTransactionalBatch.UpdateEntity does not merge entities #18433

Closed
dzendras opened this issue Feb 4, 2021 · 4 comments · Fixed by #18446
Closed

[BUG] TableTransactionalBatch.UpdateEntity does not merge entities #18433

dzendras opened this issue Feb 4, 2021 · 4 comments · Fixed by #18446
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables

Comments

@dzendras
Copy link

dzendras commented Feb 4, 2021

Describe the bug
You cannot merge entities inside a transactional batch. The TableUpdateMode argument is ignored and entities are always overwritten.
Given an entity in TS with property A, when attempting to merge property B into it, then property A is erased and the entity only contains property B.

Expected behavior
The entity in TS contains 2 properties: A & B.

Actual behavior (include Exception or Stack Trace)
What is the actual behavior?

The entity in TS contains only the property B;

PS. Property B can be added to the entity without erasing property A, only when using the table client directly (TableClient.UpdateEntity), bypassing batching.

To Reproduce

var client = new TableClient("<connectionString>", "tableName");
await client.AddEntityAsync(new TableEntity
{
	PartitionKey = "PK",
	RowKey = "RK",
	["A"] = "valueA"
});
var batch = client.CreateTransactionalBatch("PK");
var entity = new TableEntity
{
	PartitionKey = "PK",
	RowKey = "RK",
	["B"] = "valueB"
};
batch.UpdateEntity(entity, ETag.All, TableUpdateMode.Merge);
await batch.SubmitBatchAsync();

var entityAfterMerge = (await client.GetEntityAsync<TableEntity>("PK", "RK")).Value;
entityAfterMerge.ContainsKey("A") == false; //should return true!

Environment:
Azure.Data.Tables 3.0.0-beta5
Windows 10 Pro
Tried against an Azure-hosted real TableStorage as well as against Windows Azure Storage Emulator 5.10.0.0
.NET Core 3.1

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Feb 4, 2021
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Tables labels Feb 4, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Feb 4, 2021
@jsquire
Copy link
Member

jsquire commented Feb 4, 2021

Thank you for your feedback. Tagging and routing to the team member best able to assist.

@christothes
Copy link
Member

@dzendras Thank you! I have a PR to address this.

@dzendras
Copy link
Author

dzendras commented Feb 6, 2021

Thanks to everyone involved! Is beta-6 approaching any time soon?

@christothes
Copy link
Member

@dzendras it should be released next month.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants