Commit fe253c1
committed
fix: Add defensive Array.base_type handling with logging
Add logging and defensive attribute access for Array.base_type in code
generation to prevent potential AttributeError. While Array.__init__
always sets base_type, defensive programming with warnings provides:
- Protection against edge cases or future Array implementation changes
- Clear visibility when fallback occurs via logger.warning
- Consistent error handling across both usage sites
Changes:
- Add logging module and logger instance
- Update _get_feast_type_name() to use getattr with warning
- Update import tracking logic to use getattr with warning
- Add concise comments with examples (e.g., Array(String) -> base_type = String)
Addresses code review feedback from PR feast-dev#5827.
Signed-off-by: yassinnouh21 <[email protected]>1 parent b2901f4 commit fe253c1
1 file changed
+26
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| |||
123 | 126 | | |
124 | 127 | | |
125 | 128 | | |
126 | | - | |
127 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
128 | 140 | | |
129 | 141 | | |
130 | 142 | | |
| |||
293 | 305 | | |
294 | 306 | | |
295 | 307 | | |
296 | | - | |
| 308 | + | |
| 309 | + | |
297 | 310 | | |
298 | 311 | | |
299 | | - | |
300 | | - | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
301 | 322 | | |
302 | 323 | | |
303 | 324 | | |
| |||
0 commit comments