Use `pendulum` for timestamp parsing

drop_pandas
Tyler Goodlet 2022-05-15 13:39:30 -04:00
parent a3b2ba9ae9
commit 6e2e2fc03f
1 changed files with 1 additions and 11 deletions

View File

@ -40,7 +40,6 @@ from bidict import bidict
import msgpack
import pyqtgraph as pg
import numpy as np
import pandas as pd
import tractor
from trio_websocket import open_websocket_url
from anyio_marketstore import (
@ -268,7 +267,7 @@ def quote_to_marketstore_structarray(
'''
if last_fill:
# new fill bby
now = timestamp(last_fill)
now = int(pendulum.parse(last_fill).timestamp)
else:
# this should get inserted upstream by the broker-client to
# subtract from IPC latency
@ -298,15 +297,6 @@ def quote_to_marketstore_structarray(
return np.array([tuple(array_input)], dtype=_quote_dt)
def timestamp(date, **kwargs) -> int:
'''
Return marketstore compatible 'Epoch' integer in nanoseconds
from a date formatted str.
'''
return int(pd.Timestamp(date, **kwargs).value)
@acm
async def get_client(
host: str = 'localhost',