Commit 407cffc
committed
fix: Infer entity value types from dbt column types
When creating entities from dbt models with integer columns, entities were
being created with default ValueType.STRING, causing validation errors:
"Entity X has type ValueType.STRING, which does not match the inferred type Int64"
Solution: Added mapping dict and helper function for clean type conversion:
- FEAST_TYPE_TO_VALUE_TYPE: Maps FeastType to ValueType
- feast_type_to_value_type(): Helper function for conversion
- _infer_entity_value_type(): Method in DbtToFeastMapper class
This replaces verbose if-else chains with a clean dictionary lookup pattern.
Also corrects schema generation to include entity columns, as FeatureView.__init__
expects to extract entity columns from the schema itself (lines 216-234 in
feature_view.py).
Changes:
- feast/cli/dbt_import.py: Use mapper's _infer_entity_value_type() method
- feast/dbt/mapper.py: Add type mapping dict and helper method
Signed-off-by: yassinnouh21 <yassinnouh21@gmail.com>1 parent be2eb9e commit 407cffc
2 files changed
+45
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
228 | 230 | | |
229 | 231 | | |
230 | 232 | | |
| 233 | + | |
231 | 234 | | |
232 | 235 | | |
233 | 236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
29 | 47 | | |
30 | 48 | | |
31 | 49 | | |
| |||
180 | 198 | | |
181 | 199 | | |
182 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
183 | 209 | | |
184 | 210 | | |
185 | 211 | | |
| |||
310 | 336 | | |
311 | 337 | | |
312 | 338 | | |
313 | | - | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
314 | 342 | | |
315 | 343 | | |
316 | 344 | | |
| |||
330 | 358 | | |
331 | 359 | | |
332 | 360 | | |
333 | | - | |
334 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
335 | 365 | | |
336 | 366 | | |
337 | 367 | | |
338 | | - | |
| 368 | + | |
339 | 369 | | |
340 | 370 | | |
341 | 371 | | |
| |||
352 | 382 | | |
353 | 383 | | |
354 | 384 | | |
| 385 | + | |
| 386 | + | |
355 | 387 | | |
356 | 388 | | |
357 | 389 | | |
| 390 | + | |
358 | 391 | | |
359 | 392 | | |
360 | 393 | | |
| |||
405 | 438 | | |
406 | 439 | | |
407 | 440 | | |
408 | | - | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
409 | 444 | | |
410 | 445 | | |
411 | 446 | | |
412 | 447 | | |
413 | 448 | | |
| 449 | + | |
414 | 450 | | |
415 | 451 | | |
416 | 452 | | |
417 | 453 | | |
| 454 | + | |
418 | 455 | | |
419 | 456 | | |
420 | 457 | | |
| |||
0 commit comments