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] Azure.Data.Tables SDK: Type error when accessing PartitionKey or RowKey in non-string property values are set. #40775

Closed
tq20202020 opened this issue Dec 13, 2023 · 0 comments · Fixed by #41496
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 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

@tq20202020
Copy link

tq20202020 commented Dec 13, 2023

Library name and version

Azure.Data.Tables 12.8.2

Describe the bug

var a = new TableEntity(partitionKey="partKey", rowKey="rowKey");
a["PartitionKey"] = new DateTime(); a["RowKey"] = new DateTime();
a.PartitionKey <--- throws type conversion error

Expected behavior

type error should be thrown when setting the value of PartitionKey/RowKey if we expect it to be string.
or accessing PartitionKey should return convered string value.

in addition, properties set through constructor should be immutable and should not be overwritten later by setting property value. so an exception should be raised when try to modify it in the property bag, this can avoid undefined behavior on which value should be respected (the one set in constructor, or the one set in property bag).

Actual behavior

var a = new TableEntity(partitionKey="partKey", rowKey="rowKey");
a["PartitionKey"] = new DateTime(); a["RowKey"] = new DateTime();
a.PartitionKey <--- throws type conversion error

Reproduction Steps

var a = new TableEntity(partitionKey="partKey", rowKey="rowKey");
a["PartitionKey"] = new DateTime(); a["RowKey"] = new DateTime();
a.PartitionKey <--- throws type conversion error

Environment

.NetCore

@github-actions github-actions bot added 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-triage This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Tables labels Dec 13, 2023
@christothes christothes self-assigned this Dec 13, 2023
@christothes christothes removed the needs-team-triage This issue needs the team to triage. label Dec 13, 2023
@github-actions github-actions bot added the needs-team-attention This issue needs attention from Azure service team or SDK team label Dec 13, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Apr 23, 2024
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 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.

2 participants