mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-08 02:55:26 +08:00
BUG: Explicitly guard against empty bar data in history container
contstruction. BarData can be falsey. in create_buffer_panel, the intention of the check against bar_data was to see if it was passed at all, not if it was truthey. In order to make that check more explicit, the check now asserts that bar_data is not None.
This commit is contained in:
@@ -22,7 +22,7 @@ import numpy as np
|
||||
import pandas as pd
|
||||
from pandas.util.testing import assert_frame_equal
|
||||
|
||||
from zipline.history import history, Frequency
|
||||
from zipline.history import history
|
||||
from zipline.history.history_container import HistoryContainer
|
||||
from zipline.protocol import BarData
|
||||
import zipline.utils.factory as factory
|
||||
|
||||
@@ -594,7 +594,7 @@ class HistoryContainer(object):
|
||||
)
|
||||
self.buffer_spec = spec
|
||||
|
||||
if bar_data:
|
||||
if bar_data is not None:
|
||||
frame = self.frame_from_bardata(bar_data, initial_dt)
|
||||
rp.add_frame(initial_dt, frame)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user