UCBoulder / signalvine-sdk

Use the SignalVine API with Python
Apache License 2.0
0 stars 1 forks source link

Doesn't catch improperly formatted dates #2

Open staylorx opened 3 years ago

staylorx commented 3 years ago

I went with DataFrames for ins and outs, but the import is weirdly silent about failed datetimes.

For now, using:

    # Format the dates
    if 'birthdate' in df.columns:
        df['birthdate'] = pd.to_datetime(df.birthdate).dt.strftime('%Y-%m-%d')
    if 'decision_date' in df.columns:
        df['decision_date'] = pd.to_datetime(df.decision_date).dt.strftime('%Y-%m-%d')
    if 'created_at' in df.columns:
        df['created_at'] = pd.to_datetime(df.created_at).dt.strftime('%Y-%m-%d %H:%M:%S')
staylorx commented 3 years ago

When I grab the column names I do also get the types, so maybe move this into the sdk. However, I am potentially changing data, specifically created_at (TODO: verify that the timezone info doesn't skew).