Repository navigation
Commit f555e51
fix: close leaked InMemoryCatalog in test_pyarrow.py catalog fixture
Fixes ResourceWarning unclosed database connections in test_pyarrow.py tests.
The local catalog fixture (line 1508-1510) shadowed the global properly-closing
fixture from conftest.py. It returned the InMemoryCatalog without yielding or
calling close(), leaving SQLite connections uncovered.
This fixture is used by 6 tests in the file (8 instances total including
parametrized variants):
- test_identity_transform_column_projection
- test_identity_transform_column_projection_with_falsy_value (3 parametrized)
- test_identity_transform_columns_projection
- test_inspect_partition_for_nested_field
- test_inspect_partitions_respects_partition_evolution
- test_partition_column_projection_with_schema_evolution
Changed the fixture to a generator that yields and closes the catalog on
teardown, matching the pattern established in conftest.py and elsewhere on
this branch for issue apache#2530.
All 8 affected tests now pass without ResourceWarnings.
Co-Authored-By: Claude Haiku 4.5 <[email protected]>1 parent 6b110a7 commit f555e51
1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1506 | 1506 | | |
1507 | 1507 | | |
1508 | 1508 | | |
1509 | | - | |
1510 | | - | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
| 1512 | + | |
1511 | 1513 | | |
1512 | 1514 | | |
1513 | 1515 | | |
| |||
0 commit comments