Existing cache for local dataset builder file updates is ignored with `ignore_verifications=True`
MEMBER
Hi ! I just tried to reproduce what you said:
- create a local builder class
- use `load_dataset`
- update the builder class code
- use `load_dataset` again (with or without `ignore_verifications=True`)
And it creates a new cache, as expected.

What modifications did you do to your builder's code ?
2021-06-29T08:48:19Z
https://github.com/huggingface/datasets/issues/2561#issuecomment-870405067
https://api.github.com/repos/huggingface/datasets/issues/2561
MDEyOklzc3VlQ29tbWVudDg3MDQwNTA2Nw==
https://api.github.com/repos/huggingface/datasets/issues/comments/870405067/reactions
2021-06-29T08:48:19Z
https://api.github.com/repos/huggingface/datasets/issues/comments/870405067
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
Hi @lhoestq. Thanks for your reply. I just did minor modifications for which it should not regenerate cache (for e.g. Adding a print statement). Overall, regardless of cache miss, there should be an explicit option to allow reuse of existing cache if author knows cache shouldn't be affected.
2021-06-29T08:51:02Z
https://github.com/huggingface/datasets/issues/2561#issuecomment-870407052
https://api.github.com/repos/huggingface/datasets/issues/2561
MDEyOklzc3VlQ29tbWVudDg3MDQwNzA1Mg==
https://api.github.com/repos/huggingface/datasets/issues/comments/870407052/reactions
2021-06-29T08:51:02Z
https://api.github.com/repos/huggingface/datasets/issues/comments/870407052
https://avatars.githubusercontent.com/u/3616806?v=4
https://api.github.com/users/apsdehal/events{/privacy}
https://api.github.com/users/apsdehal/followers
https://api.github.com/users/apsdehal/following{/other_user}
https://api.github.com/users/apsdehal/gists{/gist_id}
https://github.com/apsdehal
apsdehal
MDQ6VXNlcjM2MTY4MDY=
https://api.github.com/users/apsdehal/orgs
https://api.github.com/users/apsdehal/received_events
https://api.github.com/users/apsdehal/repos
https://api.github.com/users/apsdehal/starred{/owner}{/repo}
https://api.github.com/users/apsdehal/subscriptions
User
https://api.github.com/users/apsdehal
public
MEMBER
The cache is based on the hash of the dataset builder's code, so changing the code makes it recompute the cache.

You could still rename the cache directory of your previous computation to the new expected cache directory if you want to avoid having to recompute it and if you're sure that it would generate the exact same result.

The verifications are data integrity verifications: it checks the checksums of the downloaded files, as well as the size of the generated splits.
2021-06-29T13:30:32Z
https://github.com/huggingface/datasets/issues/2561#issuecomment-870601983
https://api.github.com/repos/huggingface/datasets/issues/2561
MDEyOklzc3VlQ29tbWVudDg3MDYwMTk4Mw==
https://api.github.com/repos/huggingface/datasets/issues/comments/870601983/reactions
2021-06-29T13:30:32Z
https://api.github.com/repos/huggingface/datasets/issues/comments/870601983
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
COLLABORATOR
Hi @apsdehal,

If you decide to follow @lhoestq's suggestion to rename the cache directory of your previous computation to the new expected cache directory, you can do the following to get the name of the new expected cache directory once #2500 is merged:
```python
from datasets import load_dataset_builder
dataset_builder = load_dataset_builder("path/to/your/dataset")
print(dataset_builder.cache_dir)
```

This way, you don't have to recompute the hash of the dataset script yourself each time you modify the script.
2021-06-30T12:55:24Z
https://github.com/huggingface/datasets/issues/2561#issuecomment-871379644
https://api.github.com/repos/huggingface/datasets/issues/2561
MDEyOklzc3VlQ29tbWVudDg3MTM3OTY0NA==
https://api.github.com/repos/huggingface/datasets/issues/comments/871379644/reactions
2021-06-30T12:55:24Z
https://api.github.com/repos/huggingface/datasets/issues/comments/871379644
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
## Describe the bug
If i have local file defining a dataset builder class and I load it using `load_dataset` functionality, the existing cache is ignored whenever the file is update even with `ignore_verifications=True`. This slows down debugging and cache generator for very large datasets.

## Steps to reproduce the bug

- Create a local dataset builder class
- load the local builder class file using `load_dataset` and let the cache build
- update the file's content
- The cache should rebuilt.

## Expected results

With `ignore_verifications=True`, `load_dataset` should pick up existing cache.

## Actual results

Creates new cache.

## Environment info
<!-- You can run the command `datasets-cli env` and copy-and-paste its output below. -->
- `datasets` version: 1.8.0
- Platform: Linux-5.4.0-52-generic-x86_64-with-debian-bullseye-sid
- Python version: 3.7.7
- PyArrow version: 3.0.0
