Skip to content
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

Prioritize module.builder_kwargs over defaults in TestCommand #3672

Merged
merged 1 commit into from
Feb 4, 2022

Conversation

lvwerra
Copy link
Member

@lvwerra lvwerra commented Feb 3, 2022

This fixes a bug in the TestCommand where multiple kwargs for name were passed if it was set in both default and module.builder_kwargs. Example error:

Traceback (most recent call last):
  File "create_metadata.py", line 96, in <module>
    main(**vars(args))
  File "create_metadata.py", line 86, in main
    metadata_command.run()
  File "/opt/conda/lib/python3.7/site-packages/datasets/commands/test.py", line 144, in run
    for j, builder in enumerate(get_builders()):
  File "/opt/conda/lib/python3.7/site-packages/datasets/commands/test.py", line 141, in get_builders
    name=name, cache_dir=self._cache_dir, data_dir=self._data_dir, **module.builder_kwargs
TypeError: type object got multiple values for keyword argument 'name'

Let me know what you think.

Copy link
Member

@lhoestq lhoestq left a comment

Choose a reason for hiding this comment

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

Thanks for the fix ! Feel free to merge if it's good for you

@lvwerra lvwerra merged commit 7f103c1 into master Feb 4, 2022
@lvwerra lvwerra deleted the fix-test-command-builder-name branch February 4, 2022 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants