diff options
Diffstat (limited to 'python/db.py')
| -rw-r--r-- | python/db.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/python/db.py b/python/db.py index 518a1539..e0ae3dd4 100644 --- a/python/db.py +++ b/python/db.py @@ -8,9 +8,11 @@ from sqlalchemy import create_engine from sqlalchemy.engine.url import URL import numpy as np + class InfDateAdapter: def __init__(self, wrapped): self.wrapped = wrapped + def getquoted(self): if self.wrapped == datetime.date.max: return b"'infinity'::date" @@ -19,6 +21,7 @@ class InfDateAdapter: else: return psycopg2.extensions.DateFromPy(self.wrapped).getquoted() + def nan_to_null(f, _NULL=AsIs('NULL'), _Float=psycopg2.extensions.Float): if not np.isnan(f): |
