Commit 4e23442
committed
fix: add explicit boolean check in FallbackHashEmbeddings constructor
- Add isinstance(dimension, bool) check that raises TypeError
- Prevents boolean values from being accepted as dimensions
- Maintains existing ValueError for other non-int types
- Improves type safety and error message clarity
This addresses the issue where bool is a subclass of int in Python,
which could lead to unexpected behavior when boolean values are
passed as dimension parameters.1 parent 5a2d3b2 commit 4e23442
1 file changed
+2
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
| 108 | + | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
| |||
0 commit comments