1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-06-06 05:51:17 +08:00

fix bug that duplicate rows will cause reindex failed when dumping with csv files

This commit is contained in:
chaosyu
2021-06-25 09:38:49 +08:00
committed by you-n-g
parent 4610e16ac2
commit 79026e5390

View File

@@ -244,6 +244,10 @@ class DumpDataBase:
if df is None or df.empty:
logger.warning(f"{code} data is None or empty")
return
# try to remove dup rows or it will cause exception when reindex.
df = df.drop_duplicates(self.date_field_name)
# features save dir
features_dir = self._features_dir.joinpath(code_to_fname(code).lower())
features_dir.mkdir(parents=True, exist_ok=True)