Skip to content

fix(load): strip deprecated use_auth_token from config_kwargs #7654

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArjunJagdale
Copy link
Contributor

Fixes #7504

This PR resolves a compatibility error when loading datasets via load_dataset() using outdated arguments like use_auth_token.

What was happening:
Users passing use_auth_token in load_dataset(..., use_auth_token=...) encountered a ValueError: BuilderConfig ParquetConfig(...) doesn't have a 'use_auth_token' key.

Why:
use_auth_token has been deprecated and removed from config definitions (replaced by token), but the load_dataset() function still forwarded it via **config_kwargs to BuilderConfigs, leading to unrecognized key errors.

Fix:
We now intercept and strip use_auth_token from config_kwargs inside load_dataset, replacing it with a warning:

if "use_auth_token" in config_kwargs:
    logger.warning("The 'use_auth_token' argument is deprecated. Please use 'token' instead.")
    config_kwargs.pop("use_auth_token")

This ensures legacy compatibility while guiding users to switch to the token argument.

Let me know if you'd prefer a deprecation error instead of a warning. Thanks!

Fixes huggingface#7504

This PR resolves a compatibility error when loading datasets via `load_dataset()` using outdated arguments like `use_auth_token`.

🔧 **What was happening:**
Users passing `use_auth_token` in `load_dataset(..., use_auth_token=...)` encountered a `ValueError`:
BuilderConfig ParquetConfig(...) doesn't have a 'use_auth_token' key.

javascript
Copy
Edit

🔍 **Why:**
`use_auth_token` has been deprecated and removed from config definitions (replaced by `token`), but the `load_dataset()` function still forwarded it via `**config_kwargs` to BuilderConfigs, leading to unrecognized key errors.

✅ **Fix:**
We now intercept and strip `use_auth_token` from `config_kwargs` inside `load_dataset`, replacing it with a warning:
```python
if "use_auth_token" in config_kwargs:
    logger.warning("The 'use_auth_token' argument is deprecated. Please use 'token' instead.")
    config_kwargs.pop("use_auth_token")
This ensures legacy compatibility while guiding users to switch to the token argument.

Let me know if you'd prefer a deprecation error instead of a warning. Thanks!
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.

BuilderConfig ParquetConfig(...) doesn't have a 'use_auth_token' key.
1 participant