Skip to content

Commit

Permalink
pep8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LilithWittmann committed Sep 22, 2015
1 parent c8ce042 commit 46886a3
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions airflow/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from sqlalchemy import event, exc
from sqlalchemy.pool import Pool

import numpy
import numpy as np

from airflow import settings
from airflow.configuration import conf
Expand Down Expand Up @@ -626,13 +626,14 @@ def default(self, obj):
return obj.strftime('%Y-%m-%dT%H:%M:%SZ')
elif isinstance(obj, date):
return obj.strftime('%Y-%m-%d')
elif type(obj) in [numpy.int_, numpy.intc, numpy.intp, numpy.int8,
numpy.int16, numpy.int32, numpy.int64, numpy.uint8, numpy.uint16, numpy.uint32, numpy.uint64]:
elif type(obj) in [np.int_, np.intc, np.intp, np.int8, np.int16,
np.int32, np.int64, np.uint8, np.uint16,
np.uint32, np.uint64]:
return int(obj)
elif type(obj) in [numpy.bool_]:
elif type(obj) in [np.bool_]:
return bool(obj)
elif type(obj) in [numpy.float_, numpy.float16, numpy.float32, numpy.float64,
numpy.complex_, numpy.complex64, numpy.complex128]:
elif type(obj) in [np.float_, np.float16, np.float32, np.float64,
np.complex_, np.complex64, np.complex128]:
return float(obj)

# Let the base class default method raise the TypeError
Expand Down

0 comments on commit 46886a3

Please sign in to comment.