Skip to content

Fewer open files - #7303

Merged
jrbourbeau merged 9 commits into
dask:mainfrom
jsignell:fewer-open-files
Sep 1, 2021
Merged

jrbourbeau merged 9 commits into
dask:mainfrom
jsignell:fewer-open-files

Conversation

@jsignell

@jsignell jsignell commented Mar 2, 2021

Copy link
Copy Markdown
Member

Comment thread dask/bytes/tests/test_http.py Resolved
Comment thread dask/dataframe/io/parquet/arrow.py Outdated
else:
for piece, fn in zip(dataset.pieces, fns):
md = piece.get_metadata()
md = cls.collect_file_metadata(piece.path, fs, None)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rjzamora it sounds like you have a better solution for this upstream?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you are referring to #7295 ? (Which fixes a different problem with the create_metadata_file code path)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah ok. So does this seem like a reasonable solution? The issue was that pyarrow was doing fs.open in get_metadata and then never closing.

@rjzamora rjzamora Mar 5, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that makes sense. In that case, this looks like a good solution - Thanks for addressing this!

The only other change that might make sense is to take advantage of the fact that collect_file_metadata can handle the set_file_path update if we pass fn as the last argument. The one complication is that we would need to pass piece.path.replace(base + fs.sep, "") in the case that fn_partitioned is True. I don't feel strongly one way or the other, but if you use collect_file_metadata for the file-path update, you can remove the set_file_path logic below.

@jsignell
jsignell marked this pull request as ready for review March 4, 2021 21:53
Base automatically changed from master to main March 8, 2021 20:20
@GenevieveBuckley

Copy link
Copy Markdown
Contributor

@jsignell a lot of these failing tests look like they might be solved with fsspec/filesystem_spec#630

Right now the legacy pyarrow tests are trying to push a ParquetDatasetPiece object through the stringify_path method of fsspec, and then failing because they don't get a string returned.

@GenevieveBuckley

Copy link
Copy Markdown
Contributor

All the other local test failures seemed to be resolved easily by merging the main branch.

I can't push to your branch, but if you merge main I think that will help.

@GenevieveBuckley

Copy link
Copy Markdown
Contributor

fsspec/filesystem_spec#630 is merged. After the next fsspec release we should re-trigger the CI and see if that's fixed things here.

@github-actions github-actions Bot removed the io label Sep 1, 2021
@jsignell

jsignell commented Sep 1, 2021

Copy link
Copy Markdown
Member Author

I took out the arrow bit for now. So this is only a partial fix, but uncontroversialal

@jrbourbeau jrbourbeau left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jsignell!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"ResourceWarning: unclosed file" warnings in the test suite

5 participants