Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

Strategy for nanosecond datetime #149

Open lmazuel opened 5 years ago

lmazuel commented 5 years ago

We cannot model it in Python and the datetime native object (and we won't use numpy just for that with datetime64). Problem is mostly on deserialization, that will truncate the last numbers. On serialization, msrest accepts datetime or string, so customers can be responsible to provide a string instead of a datetime and we will send it.

I was thinking that maybe on deserialization, if we detect nanoseconds usage, we might disable parsing and return a string instead. That would allow roundtrip scenario, and in some scenarios when we don't even care about this date (update password, etc.), that should be enough. However, for people who cares, this would be a breaking change.

To be thought....