PDEP-13: The Pandas Logical Type System
github.com
github.com
I am however worried that the place to define the logical type system might be inside Arrow instead of Arrow consumers. If everyone has their own logical type system, we’re just going to end up with the same incompatibilities that Arrow was trying to solve.
This PDEP doesn't discuss nullable types at all (i.e. what is currently Float32 instead of float32), which is worth mentioning (though support is pretty good now in Pandas). If any of the core developers reads this, can I suggest `float32?` instead of `Float32`? I think it's more obvious what is intended with the question mark than with capitalization.
That being said, typing is hard. There are many ways to consider what is a type, and I don't see a clear physical/logical distinction. Whether type should determine storage method is one thing. Another consideration is whether type is intrinsic to the value (e.g. string in UTF-8, float64, etc.) or is extrinsic (e.g. length, weight, area and so on). This is somewhat based on whether the type is implied by the operations used on the value (for example, you can subtract numbers but not strings).
Edit: Also, if you're gonna treat time as a separate type, why not also have 2D and 3D coordinates as its own type? It's just hard to make an ultimate standard.