From b2640da656f24a27a33f5ac4da7f8925fd0b2a7c Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Wed, 2 Sep 2020 20:21:44 -0400 Subject: [PATCH] MAINT: Ensure at least one filter was passed to bundle clean --- zipline/data/bundles/core.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zipline/data/bundles/core.py b/zipline/data/bundles/core.py index 761e10e330..229a547c10 100644 --- a/zipline/data/bundles/core.py +++ b/zipline/data/bundles/core.py @@ -182,8 +182,9 @@ class BadClean(click.ClickException, ValueError): """ def __init__(self, before, after, keep_last): super(BadClean, self).__init__( - 'Cannot pass a combination of `before` and `after` with' - '`keep_last`. Got: before=%r, after=%r, keep_n=%r\n' % ( + 'Cannot pass a combination of `before` and `after` with ' + '`keep_last`. Must pass one. ' + 'Got: before=%r, after=%r, keep_last=%r\n' % ( before, after, keep_last, @@ -578,6 +579,9 @@ def clean(name, if e.errno != errno.ENOENT: raise raise UnknownBundle(name) + + if before is after is keep_last is None: + raise BadClean(before, after, keep_last) if ((before is not None or after is not None) and keep_last is not None): raise BadClean(before, after, keep_last)