BACKGROUND:
I've been trying to compare two dates in a database to see when records were last modified and if they should be updated again. I'm relatively new to using both Python 2.7 and Cassandra 3.0, and I haven't found any other answers for how to do this.
PROBLEM:
if(last_modified <= db_last_modified):
TypeError: can't compare datetime.datetime to Date
ADDITIONAL INFORMATION
#I'm getting the last_modified record in the database
last_modified = self.object.record.last_modified
db_last_modified = record_helper.get_last_modified_record()[0]['last_modified']
print(type(last_modified)) # <type 'datetime.datetime'>
print(type(db_last_modified)) # <class 'cassandra.util.Date'>
if(last_modified <= db_last_modified):
print("Already processed newer or equivalent version.")
logging.info("Already processed a newer version of the metadata. Please check your files and try again.")
return