Add skip_origin_metadata flag to optimize streaming startup time#8291
Open
yuxin00j wants to merge 6 commits into
Open
Add skip_origin_metadata flag to optimize streaming startup time#8291yuxin00j wants to merge 6 commits into
skip_origin_metadata flag to optimize streaming startup time#8291yuxin00j wants to merge 6 commits into
Conversation
zhixiangli
reviewed
Jul 9, 2026
zhixiangli
reviewed
Jul 10, 2026
| data_dir=data_dir, | ||
| data_files=data_files, | ||
| cache_dir=cache_dir, | ||
| skip_origin_metadata=skip_origin_metadata, |
There was a problem hiding this comment.
nit: why not skip_origin_metadata=config_kwargs.get("skip_origin_metadata", False)
Author
There was a problem hiding this comment.
Fixed in the latest commit! I've inlined the .get() call here and then properly extracted it with .pop() when instantiating the builder later to prevent kwargs leakage.
Author
|
Hi @lhoestq, could you take a look at this PR? Thanks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #8197
This PR introduces the
skip_origin_metadatakwarg to skip costly origin metadata fetching (ETags/mtime) when it's not needed, improving streaming initialization latency.Changes
skip_origin_metadatakwarg fromload_dataset(...)safely down toDatasetBuilderwhile stripping it securely from kwargs (via.pop()) so it's not leaked into underlying configuration classes that don't expect it (such asCsvConfig()).skip_origin_metadata=Trueis passed toload_datasetwithoutstreaming=True.download_and_prepare()entirely whenbuilder._skip_origin_metadatais true by raising aValueError("This function is not intended for streaming.").tests/test_data_files.pyandtests/test_load.py:test_DataFilesList_from_patterns_skip_origin_metadatatest_DataFilesList_from_patterns_skip_origin_metadata_raises_FileNotFoundErrortest_load_dataset_builder_skip_origin_metadata(covers kwarg mapping & ValueError)test_load_dataset_skip_origin_metadata_warning