It seems fitting to talk about date time objects on leap day!
We use the awesome python package arrow in our codebase for convenient and developer friendly manipulation of datetime objects. Although arrow is datetime compatible, it was not immediately compatible with the DataStax Cassandra Driver out of the box.
Fortunately, the DataStax driver is open source! Of course, it’s useful to read and learn from, but it also helped me figure out the solution. Stepping through the driver’s code, I eventually stumbled upon this section of code:
This wonderful docstring even says that users can directly update the mapping to including their own datatypes. Since arrow is datetime compatible, we are able to add support for arrow objects with the following line of code:
That’s it! I hope that was useful for you. Our APIs are written in Python and we heavily leverage both Redis and Cassandra to support our mobile app, mCent. If you’re interested in full stack development, please contact us!