From 825866948bbb8c2eb7bf6bee038881d646985788 Mon Sep 17 00:00:00 2001 From: Jean Bredeche Date: Sat, 22 Apr 2017 14:20:15 -0400 Subject: [PATCH] BUG: get_splits should return empty list, not empty dict --- tests/test_data_portal.py | 4 ++++ zipline/data/data_portal.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_data_portal.py b/tests/test_data_portal.py index 26391f60..8f08d730 100644 --- a/tests/test_data_portal.py +++ b/tests/test_data_portal.py @@ -401,6 +401,10 @@ class DataPortalTestBase(WithDataPortal, "Asset 10000 had a trade on fourth minute, so should " "return that as the last trade on the fifth.") + def test_get_empty_splits(self): + splits = self.data_portal.get_splits([], self.trading_days[2]) + self.assertEqual([], splits) + class TestDataPortal(DataPortalTestBase): DATA_PORTAL_LAST_AVAILABLE_SESSION = None diff --git a/zipline/data/data_portal.py b/zipline/data/data_portal.py index 09860cfc..bd4cb61b 100644 --- a/zipline/data/data_portal.py +++ b/zipline/data/data_portal.py @@ -1139,7 +1139,7 @@ class DataPortal(object): List of splits, where each split is a (asset, ratio) tuple. """ if self._adjustment_reader is None or not assets: - return {} + return [] # convert dt to # of seconds since epoch, because that's what we use # in the adjustments db