Add type conversion for Panda's Timestamp

Add type conversion for Panda's Timestamp, if Panda library is present in system
(thanks for this project, I was about to do the same thing from scratch)
This commit is contained in:
bob 2020-03-29 09:36:30 -04:00 committed by GitHub
commit fdf7cb4a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,6 +8,12 @@ import pathlib
SQLITE_MAX_VARS = 999
try:
import pandas as pd
except ImportError:
pd = None
try:
import numpy as np
except ImportError:
@ -64,6 +70,13 @@ if np:
}
)
# If pandas is available, add more types
if pd:
COLUMN_TYPE_MAPPING.update(
{
pd.Timestamp: "TEXT"
})
class AlterError(Exception):
pass