You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"ResourceWarning: unclosed file" warnings in the test suite #7167
needs attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.needs infoNeeds further information from the usertestsUnit tests and/or continuous integration
A lot of these are also coming from parquet. It doesn't seem like there is any attempt at closing files in pyarrow. I am not sure how best to workaround this or if I am missing something. In particular, these parts seem to cause issues:
Traceback (most recent call last):
File "/home/julia/dask/dask/dataframe/io/parquet/arrow.py", line 1586, in _parquet_piece_as_arrow
arrow_table = piece.read(
ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/pytest-of-julia/pytest-39/popen-gw7/test_select_partitioned_column1/fake_categorical1=C/fake_categorical2=E/part.1.parquet'>
Traceback (most recent call last):
File "/home/julia/dask/dask/dataframe/io/parquet/arrow.py", line 1786, in _gather_metadata
md = piece.get_metadata()
ResourceWarning: unclosed file <_io.BufferedReader name='/tmp/pytest-of-julia/pytest-39/popen-gw7/test_categories_large_pyarrow_0/parquet_int16.parq'>
I am wondering if we need to write our own versions of get_metadata and piece.read@rjzamora
@jrbourbeau I've recently been doing a lot of running the test suite locally, and I'm not seeing the kinds of warnings you described.
Is this still happening for you? If not, perhaps we can close the issue.
needs attentionIt's been a while since this was pushed on. Needs attention from the owner or a maintainer.needs infoNeeds further information from the usertestsUnit tests and/or continuous integration
Activity
jsignell commentedon Mar 2, 2021
A lot of these are also coming from parquet. It doesn't seem like there is any attempt at closing files in pyarrow. I am not sure how best to workaround this or if I am missing something. In particular, these parts seem to cause issues:
I am wondering if we need to write our own versions of
get_metadataandpiece.read@rjzamorajsignell commentedon Mar 2, 2021
I will open a PR to try to make this discussion clearer.
jrbourbeau commentedon Mar 2, 2021
Awesome, thanks @jsignell
GenevieveBuckley commentedon Sep 2, 2021
7303 was a partial fix - should this issue be kept open to track the remaining arrow stuff?
jrbourbeau commentedon Sep 2, 2021
Whoops, good catch @GenevieveBuckley -- reopening
GenevieveBuckley commentedon Oct 14, 2021
@jrbourbeau I've recently been doing a lot of running the test suite locally, and I'm not seeing the kinds of warnings you described.
Is this still happening for you? If not, perhaps we can close the issue.
jrbourbeau commentedon Oct 14, 2021
Just checked the latest CI build on
mainand, indeed, these unclosed fileResourceWarningare gone 🎉Thanks for following-up here @GenevieveBuckley
j-bennet commentedon Mar 15, 2023
This came up again, CI job:
https://github.com/dask/dask/actions/runs/4421267540/jobs/7751871262
Reopening to fix again.