Skip to content

Commit 4831051

Browse files
author
Yalin Li
authored
[Tables] Enable PartitionKey and RowKey type exceptions to be more informative (Azure#23642)
1 parent 4ab14c9 commit 4831051

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdk/tables/azure-data-tables/azure/data/tables/_serialize.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ def _get_match_headers(etag, match_condition):
3434

3535
def _prepare_key(keyvalue):
3636
"""Duplicate the single quote char to escape."""
37-
return keyvalue.replace("'", "''")
37+
try:
38+
return keyvalue.replace("'", "''")
39+
except AttributeError:
40+
raise TypeError('PartitionKey or RowKey must be of type string.')
3841

3942

4043
def _parameter_filter_substitution(parameters, query_filter):

0 commit comments

Comments
 (0)