Skip to content

Conversation

@abhayk-c
Copy link

The kaggle-api module init.py creates an instance of the KaggleAPI and authenticates. If the user has not added a Kaggle API token in their local environment, this code causes a Kaggle.json not found exception to be thrown immediately on package import.

This assertion prevents the user from being able to use the kaggle python API for features that don't need authentication, like the downloading of public data sets. I verified we can download public data sets without authentication using the CLI commands and this feature was already publicly announced here: https://www.kaggle.com/discussions/product-feedback/485439

The existing code doesn't seem to add much value, it seems reasonable to give the developer (importer of the package), the responsibility to simply create an instance of KaggleAPI and authenticate as needed. By removing this code, both the CLI API and the python API can now download public data sets without authentication keeping the behavior consistent. I think it's pretty confusing to allow user's to call the CLI api without authenticating, but force them to authenticate when using the Python API directly. If anything the CLI API should be more restrictive. If this change is rejected, then I highly recommend removing this capability from the CLI API.

The kaggle-api module init.py creates an instance of the KaggleAPI and authenticates. If the user has not added a Kaggle API token in their local environment, this code causes a Kaggle.json not found exception to be thrown immediately on package import.

This assertion prevents the user from being able to use the kaggle python API for feature that don't need authentication, like the downloading of public data sets. I verified we can download public data sets without authentication using the CLI commands and this feature was already publicly announced here: https://www.kaggle.com/discussions/product-feedback/485439

The existing code doesn't seem to add much value, it seems reasonable to give the developer (importer of the package), the responsibility to simply create an instance of KaggleAPI and authenticate as needed. By removing this code, both the CLI API and the python API can now download public data sets without authentication keeping the behavior consistent. I think it's pretty confusing to allow user's to call the CLI api without authenticating, but force them to authenticate when using the Python API directly. If anything the CLI API should be more restrictive
@stevemessick
Copy link
Contributor

This breaks most of the CLI functionality.

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.

2 participants