Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
elif data_type == TICKER:
df = df.drop(['pair', 'feed'], axis=1)
chunk_size = 'D'
elif data_type in { L2_BOOK, L3_BOOK }:
chunk_size = 'T'
elif data_type == FUNDING:
chunk_size = 'D'
elif data_type == OPEN_INTEREST:
df = df.drop(['pair', 'feed'], axis=1)
chunk_size = 'D'
df.set_index('date', inplace=True)
# All timestamps are in UTC
df.index = df.index.tz_localize(None)
if exchange not in self.con.list_libraries():
self.con.initialize_library(exchange, lib_type=StorageEngines.arctic.CHUNK_STORE)
self.con[exchange].append(f"{data_type}-{pair}", df, upsert=True, chunk_size=chunk_size)