From 705476117cf5e84d64add3ae8ff429b912fb2252 Mon Sep 17 00:00:00 2001 From: Quan Pham Date: Wed, 28 Jan 2026 12:10:33 -0500 Subject: [PATCH] Fix compatibility issues with pandas 3 While not entirely clear, it seems the recent Pandas relase (3.0.0) changed how casting to decimal types works, causing some invoicing code to throw errors, specifically calls to read_csv() Seperating loading of the CSV and casting seems to fix this --- .../management/commands/fetch_daily_billable_usage.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py b/src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py index 18d4c9a..c32206b 100644 --- a/src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py +++ b/src/coldfront_plugin_cloud/management/commands/fetch_daily_billable_usage.py @@ -192,7 +192,9 @@ def s3_client(self): def load_csv(location) -> DataFrameGroupBy: df = pandas.read_csv( location, - dtype={INVOICE_COLUMN_COST: pandas.ArrowDtype(pyarrow.decimal128(12, 2))}, + ) + df = df.astype( + {INVOICE_COLUMN_COST: pandas.ArrowDtype(pyarrow.decimal128(12, 2))} ) return df.groupby(INVOICE_COLUMN_ALLOCATION_ID)