Azure / Azure/azure-sdk-for-python

delete_entity with TableEntity requires RowKey to be string

Aperta
#26,360 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

Nessuno ha ancora preso questa issue.

auto-close-exempt Client customer-reported feature-request needs-team-attention Tables
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g 2h
PR unite (30g)
213

Descrizione

When using `create_entity` or `upsert_entity` and passing a `TableEntity` the SDK takes care of converting the property data types. For example, the `RowKey` could have type `UUID`. See [_add_entity_properties](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/azure/data/tables/_serialize.py#L189).

`delete_entity` also offers an overload accepting a `TableEntity` - [but then uses `PartitionKey` and `RowKey` directly](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py#L336), raising a `TypeError: PartitionKey or RowKey must be of type string.` when I use my same object that I pass to `create/upsert`.

Is this expected behaviour? I can cast to string, but wouldn't it be more consistent if this would be handled by the SDK? 😇

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.