Skip to content

Commit 2ebc759

Browse files
committed
Added informative errors when passing non-text data without a custom encoder
1 parent 25817b5 commit 2ebc759

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

semhash/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ def featurize(
126126
:param model: An Encoder model.
127127
:return: The embeddings of the records.
128128
:raises ValueError: If a column is missing from one or more records.
129+
:raises TypeError: If encoding fails due to incompatible data types.
129130
"""
130131
# Extract the embeddings for each column across all records
131132
embeddings_per_col = []
@@ -141,7 +142,7 @@ def featurize(
141142
raise TypeError(
142143
f"Failed to encode column '{col}' (data type: {sample_type}). "
143144
f"If encoding non-text data, provide a compatible encoder via the `model` parameter. "
144-
f"See our documentation for more info."
145+
f"See the SemHash documentation for more info."
145146
) from e
146147
embeddings_per_col.append(np.asarray(col_emb))
147148

0 commit comments

Comments
 (0)