Describe the bug
When using the azure-data-tables package to delete an entity in a table, it throws an error when supplying a entity or a keyword argument with a empty RowKey.
To Reproduce
Steps to reproduce the behavior:
Try to delete a entity without a RowKey using the entity as input, or keyword arguments.
Eg:
delete_entity(entity={entity}) or delete_entity(partition_key='partitionkey', row_key='') or delete_entity(partition_key='partitionkey', row_key=None)
Expected behavior
To execute the function without problems and delete the entity from the table
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
When investigating the code, the problem becomes clear.
Firstly, the bug when using an entity:
When passing an entity, it tries to extract the RowKey from the entity (row 337), which throws an error when the RowKey is empty. I believe this is wrong; as the RowKey can be empty.
Secondly, the bug when using the keyword parameters partition_key and row_key:
When passing the keyword parameters, it tests if the row_key is entered using if not row_key (line 343). Because of this check, it also filters out empty strings and makes it unable to delete entities without a RowKey.
Workaround
The workaround is easy, you can pass the partition key and row key as unnamed arguments.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4