Commit 546bd46
committed
fix: Implement two-tier exception handling for Calamine panics and update test
- Add two-tier exception handling: catch Exception first, then BaseException
- PyO3 PanicException from Calamine inherits from BaseException, not Exception
- Keep targeted BLE001 suppression with explanatory comment
- Re-raise KeyboardInterrupt/SystemExit in BaseException handler
- Update calamine_exc type to Optional[BaseException] for MyPy
- Update test mocks to accept sheet_name parameter
- Verified: test passes and MyPy succeeds locally
This preserves the functional requirement to catch Calamine panics while
following Python best practices for normal exception handling.
Co-Authored-By: unknown <>1 parent 88084ad commit 546bd46
File tree
2 files changed
+19
-3
lines changed- airbyte_cdk/sources/file_based/file_types
- unit_tests/sources/file_based/file_types
2 files changed
+19
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
| 203 | + | |
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
216 | 228 | | |
217 | 229 | | |
218 | 230 | | |
| |||
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
156 | 160 | | |
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | 164 | | |
161 | | - | |
| 165 | + | |
162 | 166 | | |
163 | 167 | | |
164 | 168 | | |
| |||
0 commit comments