python - Checking if an input is in sql alchemy data-type format -


so i'm parsing information excel sheet , running data-type issues.

there different fields, dates , strings, etc. problem people idiots , inputting things incorrectly. date field might 'na' or that. trying condition if it's not correct format, replace none.

so in psuedo-code

if not( expiration_date date.format):        expiration_date = none 

however can't find online can me. there efficient way of doing this?

in case wanted code, here go:

import datetime  expiration_date=datetime.datetime.now()  if  type(expiration_date) != datetime.datetime:     expiration_date = none 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -