From fca637a40bb5d177d2a1a85fca0e5624b08f86d0 Mon Sep 17 00:00:00 2001 From: llllllllll Date: Fri, 9 Oct 2015 17:45:03 -0400 Subject: [PATCH] ENH: Adds a better error if root mask is empty --- zipline/pipeline/engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zipline/pipeline/engine.py b/zipline/pipeline/engine.py index fe56787e..bf3b47db 100644 --- a/zipline/pipeline/engine.py +++ b/zipline/pipeline/engine.py @@ -232,7 +232,10 @@ class SimplePipelineEngine(object): # Filter out columns that didn't exist between the requested start and # end dates. existed = lifetimes.iloc[extra_rows:].any() - return lifetimes.loc[:, existed] + ret = lifetimes.loc[:, existed] + shape = ret.shape + assert shape[0] * shape[1] != 0, 'root mask cannot be empty' + return ret def _mask_and_dates_for_term(self, term, workspace, graph, dates): """