Describe the bug
Request max_depth=500 on Binance spot L2_book feed, but sometimes receive less. This makes creating dataframes weird:
df = pd.DataFrame(
{
"exchange": data["exchange"],
"symbol": data["symbol"],
"bid_price": [float(k) for k in data["book"]["bid"].keys()],
"bid_amount": [float(v) for v in data["book"]["bid"].values()],
"ask_price": [float(k) for k in data["book"]["ask"].keys()],
"ask_amount": [float(v) for v in data["book"]["ask"].values()],
"timestamp": str(data["timestamp"]),
}
)
will yield the error: 'NoneType' object is not iterable
this is not necessarily a bug in cryptofeed can just check for the rows and work around what response the exchange gives, not much cryptofeed can do, my apologies
Describe the bug Request
max_depth=500
on Binance spot L2_book feed, but sometimes receive less. This makes creating dataframes weird:will yield the error:
'NoneType' object is not iterable
I believe this is relevant?
To Reproduce Steps to reproduce the behavior:
print(len(data['book']['bid'].keys()))
in the callback after converting data with to_dict() to see <500 appears sometimesExpected behavior Give length of 500 arrays of bid/ask price/amounts, with 0 as value if no amount.
Operating System:
Cryptofeed Version