question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Better int64 support

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lovettchriscommented, May 18, 2022

Cool, thanks for the quick reply. Yeah, numpy is so much of a defacto standard in the python world it makes sense to handle its datatypes in a first class way.

0reactions
YalinLi0312commented, Nov 17, 2022

@lovettchris , thanks for your waiting! We are working on re-factoring the de/serialization of TableEntity type in this semester, we’ll take your feedback into consideration. Stay tuned!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Int64 Struct (System) - Microsoft Learn
The Int64 type supports standard mathematical operations such as addition, subtraction, division, multiplication, negation, and unary negation. Like the other ...
Read more >
Accepted style for long vs Int64 in C#? [closed] - Stack Overflow
So I guess it's better usage to use them that way. long instead of Int64; int instead of Int32; short instead of Int16....
Read more >
Using int32 for efficiency or simply stick to int64? : r/golang
It is okay to use int32/int64 for performance. But then you better add Benchmarks to actually prove and track that performance is better....
Read more >
Int64 | Apple Developer Documentation
A 64-bit signed integer value type. iOS 8.0+ iPadOS 8.0+ macOS 10.10+ Mac Catalyst 13.0+ ...
Read more >
Difference between int, Int16, Int32 and Int64 - Dot Net Tricks
In this post, we'll provide you with a list of the most common C# interview questions and answers. This book is designed to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found