Azure / Azure/azure-sdk-for-python

Better int64 support

Aperta
#24,499 6 commenti 0 reazioni 1 assegnatario Assegnata a @annatisch Vedi su GitHub
Client customer-reported feature-request needs-team-attention Tables
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g
PR unite (30g)
217

Descrizione

**Is your feature request related to a problem? Please describe.**

Python integers are variable sized, for example:

```
>>> import sys
>>> sys.getsizeof(int(19283612873512536))
32
>>> sys.getsizeof(int(192836128735125361239862))
36
>>> sys.getsizeof(int(1928361287351253612398621293876))
40
```

but the current azure.data.tables entity serialization maps all python integers to int32 on Azure, which is not very friendly because you are bound to hit a nasty error at runtime when your python integer overflows int32. Then you have to monkey around the documentation and if you are lucky you discover `EntityProperty(memory, EdmType.INT64)` and change all your code to handle that properly and unwrap it on deserialization, etc. which is a big mess.

**Describe the solution you'd like**
It would be cool if this auto-conversion to int64 (or even bigger) and back to python int was completely transparent and handled in the serialization layer.

**Describe alternatives you've considered**
I am now using `EntityProperty(memory, EdmType.INT64)` but I'm not happy with it. This topic should be dealt with on page 1 of the python SDK, pointing out "int" in python is special. I don't know if you do this already, but you could also add special handling for numpy int64 datatype.

**Additional context**
N/A

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.