Skip to content

Commit

Permalink
Merge pull request #44 from martindurant/object_types
Browse files Browse the repository at this point in the history
Specify object types
  • Loading branch information
martindurant committed Dec 13, 2016
2 parents 9179be6 + dfd025f commit ea1680d
Show file tree
Hide file tree
Showing 2 changed files with 129 additions and 118 deletions.
8 changes: 6 additions & 2 deletions fastparquet/converted_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@

try:
from bson import BSON
unbson = lambda s: BSON(s).decode()
unbson = bson.BSON.decode
tobson = bson.BSON.encode
except ImportError:
try:
import bson
unbson = bson.loads
tobson = bson.dumps
except:
def BSON(x):
def unbson(x):
raise ImportError("BSON not found")
def tobson(x):
raise ImportError("BSON not found")

DAYS_TO_MILLIS = 86400000000000
Expand Down

0 comments on commit ea1680d

Please sign in to comment.