diff --git a/services/ml/app/preprocessing.py b/services/ml/app/preprocessing.py index a4595ea..26224bb 100644 --- a/services/ml/app/preprocessing.py +++ b/services/ml/app/preprocessing.py @@ -60,9 +60,9 @@ def preprocess_candles( except Exception as e: raise ValueError(f"Candle data validation failed: {e}") - # Handle missing volume column - fill with 0 if absent - if 'volume' not in df.columns: - logger.warning("Volume column missing from candle data, filling with 0") + # Handle missing or all-null volume column - fill with 0 if absent/empty + if 'volume' not in df.columns or df['volume'].isna().all(): + logger.warning("Volume data missing from candles, filling with 0") df['volume'] = 0.0 # Get feature engineering config