From 4cecaba618789af70c32479ce6a93156dabe6b21 Mon Sep 17 00:00:00 2001 From: Pengrong Zhu Date: Fri, 29 Oct 2021 22:52:42 +0800 Subject: [PATCH] fix 'duplicate axis' error when updating cache (#661) --- qlib/data/cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qlib/data/cache.py b/qlib/data/cache.py index 362270b61..180c3a744 100644 --- a/qlib/data/cache.py +++ b/qlib/data/cache.py @@ -927,7 +927,7 @@ class DiskDatasetCache(DatasetCache): meta = { "info": { "instruments": instruments, - "fields": cache_columns, + "fields": list(cache_features.columns), "freq": freq, "last_update": str(_calendar[-1]), # The last_update to store the cache "inst_processors": inst_processors, # The last_update to store the cache @@ -965,7 +965,7 @@ class DiskDatasetCache(DatasetCache): fields = d["info"]["fields"] freq = d["info"]["freq"] last_update_time = d["info"]["last_update"] - inst_processors = d["info"]["inst_processors"] + inst_processors = d["info"].get("inst_processors", []) index_data = im.get_index() self.logger.debug("Updating dataset: {}".format(d))