-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dataset builder default version #4356
Fix dataset builder default version #4356
Conversation
The documentation is not available anymore as the PR was closed or merged. |
This PR requires one of these other PRs being merged first: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh good catch ! Maybe it's worth adding a test to make sure a custom config gets the expected version ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks !
Currently, when using a custom config (subclass of
BuilderConfig
), default version set at the builder level is ignored: we must set default version in the custom config class.However, when loading a dataset with
config_kwargs
(for a configuration not present inBUILDER_CONFIGS
), the default version set in the custom config is ignored and "0.0.0" is used instead:generates the following config:
with version "0.0.0" instead of "2.0.0".
See as a counter-example, when the config is present in
BUILDER_CONFIGS
:generates the following config:
with correct version "2.0.0", as set in the custom config class.
The reason for this is that
DatasetBuilder
has a default VERSION ("0.0.0") that overwrites the default version set at the custom config class.This PR:
DatasetBuilder
(set to None, so that the class attribute exists but it does not override the custom config default version).BuilderConfig
class already sets a default version = "0.0.0"; no need to pass this from the builder.