aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/collateral/__init__.py14
-rw-r--r--python/collateral/citi.py2
2 files changed, 15 insertions, 1 deletions
diff --git a/python/collateral/__init__.py b/python/collateral/__init__.py
index 99550bc8..bb57df28 100644
--- a/python/collateral/__init__.py
+++ b/python/collateral/__init__.py
@@ -4,3 +4,17 @@ except KeyError:
sys.exit("Please set 'DAILY_DIR' and 'LOG_DIR' in the environment")
from serenitas.utils.remote import SftpClient, SftpClient2
+
+
+# monkeypatching until https://github.com/pandas-dev/pandas/issues/39001 is fixed
+from pandas.io.excel._openpyxl import OpenpyxlReader
+
+old_get_sheet_data = OpenpyxlReader.get_sheet_data
+
+
+def new_get_sheet_data(self, sheet, convert_float):
+ sheet.reset_dimensions()
+ return old_get_sheet_data(self, sheet, convert_float)
+
+
+OpenpyxlReader.get_sheet_data = new_get_sheet_data
diff --git a/python/collateral/citi.py b/python/collateral/citi.py
index f2015de2..25fc1b23 100644
--- a/python/collateral/citi.py
+++ b/python/collateral/citi.py
@@ -12,7 +12,7 @@ def load_file(d):
)
except StopIteration:
raise FileNotFoundError(f"CITI file not found for date {d}")
- return pd.read_excel(fname, skiprows=6, skipfooter=2, engine="xlrd")
+ return pd.read_excel(fname, skiprows=6, skipfooter=2)
def download_files(em, count=20, **kwargs):