Skip to content

Commit 6326dbf

Browse files
fix(KDP): fixing tests
1 parent 68ee7c5 commit 6326dbf

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

.github/workflows/UTESTS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
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"

kdp/processor.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff 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(

0 commit comments

Comments
 (0)