File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 7171 strategy :
7272 fail-fast : false
7373 matrix :
74- python-version : ["3.9 ", "3.10 ", "3.11 "]
74+ python-version : ["3.10 ", "3.11 ", "3.12 "]
7575 test-group : ["unit", "integration", "layers"]
7676 include :
7777 - python-version : " 3.11"
Original file line number Diff line number Diff line change @@ -1126,6 +1126,15 @@ def _add_categorical_lookup(
11261126 if feature .category_encoding == CategoryEncodingOptions .HASHING :
11271127 return
11281128
1129+ # Handle empty vocabulary by providing a fallback
1130+ if not vocab :
1131+ logger .warning (
1132+ f"Empty vocabulary for categorical feature '{ feature_name } '. "
1133+ "Using fallback vocabulary with placeholder values."
1134+ )
1135+ # Provide a minimal vocabulary with unknown/placeholder values
1136+ vocab = ["<UNK>" ]
1137+
11291138 # Default behavior if no specific preprocessing is defined
11301139 if feature .feature_type == FeatureType .STRING_CATEGORICAL :
11311140 preprocessor .add_processing_step (
You can’t perform that action at this time.
0 commit comments