Skip to content

Commit

Permalink
fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nooperpudd committed Sep 18, 2018
1 parent cb55b7d commit 82b648f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions ttseries/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ def loads(self, data, *args, **kwargs):
:param data: bytes
:return:obj
"""
return msgpack.unpackb(data, encoding="utf-8", object_hook=MsgPackDecoder().decode, **kwargs)
return msgpack.unpackb(data,raw=False, object_hook=MsgPackDecoder().decode, **kwargs)

def dumps(self, data, *args, **kwargs):
"""
serializer data to message-pack format
:param data: obj
:return: bytes
"""
return msgpack.packb(data, encoding="utf-8", default=MsgPackEncoder().encode, **kwargs)
return msgpack.packb(data, default=MsgPackEncoder().encode, **kwargs)


class DumpySerializer(BaseSerializer):
Expand Down
3 changes: 2 additions & 1 deletion ttseries/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ def chunks_np_or_pd_array(array, chunk_size: int = 2000):

def np_datetime64_to_timestamp(dt64, decimals=6):
"""
https://stackoverflow.com/questions/13703720/converting-between-datetime-timestamp-and-datetime64
convert np.datetime64 to python datetime.timestamp
:return: timestamp
"""
value = (dt64 - np.datetime64("1970-01-01T00:00:00Z")) / np.timedelta64(1, 's')
value = (dt64 - np.datetime64("1970-01-01T00:00:00")) / np.timedelta64(1, 's')
return float(np.around(value, decimals=decimals))


Expand Down

0 comments on commit 82b648f

Please sign in to comment.