From ed7a1f9be3fcf17b409f0abbb81f3ac20d38f4fc Mon Sep 17 00:00:00 2001 From: warproxxx Date: Sun, 22 Jun 2025 10:20:07 -0700 Subject: [PATCH] Fix AttributeError in hyperparameter parsing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Handle NaN values from pandas when CSV cells are empty - convert to string before calling strip() method. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- poly_data/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/poly_data/utils.py b/poly_data/utils.py index 5467ed0..349df39 100644 --- a/poly_data/utils.py +++ b/poly_data/utils.py @@ -45,8 +45,10 @@ def get_sheet_df(read_only=None): for r in records: # Update current_type only when we have a non-empty type value - if r['type'] and r['type'].strip(): - current_type = r['type'].strip() + # Handle both string and NaN values from pandas + type_value = r['type'] + if type_value and str(type_value).strip() and str(type_value) != 'nan': + current_type = str(type_value).strip() # Skip rows where we don't have a current_type set if current_type: