Windows Permission Error (most recent version of datasets)
{'login': 'itsLuisa', 'id': 73881148, 'node_id': 'MDQ6VXNlcjczODgxMTQ4', 'avatar_url': 'https://avatars.githubusercontent.com/u/73881148?v=4', 'gravatar_id': '', 'url': 'https://api.github.com/users/itsLuisa', 'html_url': 'https://github.com/itsLuisa', 'followers_url': 'https://api.github.com/users/itsLuisa/followers', 'following_url': 'https://api.github.com/users/itsLuisa/following{/other_user}', 'gists_url': 'https://api.github.com/users/itsLuisa/gists{/gist_id}', 'starred_url': 'https://api.github.com/users/itsLuisa/starred{/owner}{/repo}', 'subscriptions_url': 'https://api.github.com/users/itsLuisa/subscriptions', 'organizations_url': 'https://api.github.com/users/itsLuisa/orgs', 'repos_url': 'https://api.github.com/users/itsLuisa/repos', 'events_url': 'https://api.github.com/users/itsLuisa/events{/privacy}', 'received_events_url': 'https://api.github.com/users/itsLuisa/received_events', 'type': 'User', 'site_admin': False}
[]
[]
["Hi @itsLuisa !\r\n\r\nCould you give us more information about the error you're getting, please?\r\nA copy-paste of the Traceback would be nice to get a better understanding of what is wrong :) "
 'Hello @SBrandeis , this is it:\r\n```\r\nTraceback (most recent call last):\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\builder.py", line 537, in incomplete_dir\r\n    yield tmp_dir\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\builder.py", line 578, in download_and_prepare\r\n    self._download_and_prepare(\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\builder.py", line 656, in _download_and_prepare\r\n    self._prepare_split(split_generator, **prepare_split_kwargs)\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\builder.py", line 982, in _prepare_split\r\n    num_examples, num_bytes = writer.finalize()\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\arrow_writer.py", line 297, in finalize\r\n    self.write_on_file()\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\arrow_writer.py", line 230, in write_on_file\r\n    pa_array = pa.array(typed_sequence)\r\n  File "pyarrow\\array.pxi", line 222, in pyarrow.lib.array\r\n  File "pyarrow\\array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\arrow_writer.py", line 97, in __arrow_array__\r\n    out = pa.array(self.data, type=type)\r\n  File "pyarrow\\array.pxi", line 305, in pyarrow.lib.array\r\n  File "pyarrow\\array.pxi", line 39, in pyarrow.lib._sequence_to_array\r\n  File "pyarrow\\error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status\r\n  File "pyarrow\\error.pxi", line 107, in pyarrow.lib.check_status\r\npyarrow.lib.ArrowTypeError: Expected bytes, got a \'list\' object\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File "C:/Users/Luisa/Documents/Uni/WS 2020,21/Neural Networks/Final_Project/NN_Project/data_loading.py", line 122, in <module>\r\n    main()\r\n  File "C:/Users/Luisa/Documents/Uni/WS 2020,21/Neural Networks/Final_Project/NN_Project/data_loading.py", line 111, in main\r\n    dataset = datasets.load_dataset(\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\load.py", line 740, in load_dataset\r\n    builder_instance.download_and_prepare(\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\builder.py", line 586, in download_and_prepare\r\n    self._save_info()\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\contextlib.py", line 131, in __exit__\r\n    self.gen.throw(type, value, traceback)\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\site-packages\\datasets\\builder.py", line 543, in incomplete_dir\r\n    shutil.rmtree(tmp_dir)\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\shutil.py", line 740, in rmtree\r\n    return _rmtree_unsafe(path, onerror)\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\shutil.py", line 618, in _rmtree_unsafe\r\n    onerror(os.unlink, fullname, sys.exc_info())\r\n  File "C:\\Users\\Luisa\\AppData\\Local\\Programs\\Python\\Python38\\lib\\shutil.py", line 616, in _rmtree_unsafe\r\n    os.unlink(fullname)\r\nPermissionError: [WinError 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem anderen Prozess verwendet wird: \'C:\\\\Users\\\\Luisa\\\\.cache\\\\huggingface\\\\datasets\\\\sample\\\\default-20ee7d51a6a9454f\\\\0.0.0\\\\5fc4c3a355ea77ab446bd31fca5082437600b8364d29b2b95264048bd1f398b1.incomplete\\\\sample-train.arrow\'\r\n\r\nProcess finished with exit code 1\r\n```'
 'Hi @itsLuisa, thanks for sharing the Traceback.\r\n\r\nYou are defining the "id" field as a `string` feature:\r\n```python\r\nclass Sample(datasets.GeneratorBasedBuilder):\r\n    ...\r\n\r\n    def _info(self):\r\n        return datasets.DatasetInfo(\r\n            features=datasets.Features(\r\n                {\r\n                    "id": datasets.Value("string"),\r\n                    # ^^ here\r\n                    "tokens": datasets.Sequence(datasets.Value("string")),\r\n                    "pos_tags": datasets.Sequence(datasets.features.ClassLabel(names=[...])),\r\n[...]\r\n```\r\n\r\nBut in the `_generate_examples`, the "id" field is a list:\r\n```python\r\nids = list()\r\n```\r\n\r\nChanging:\r\n```python\r\n"id": datasets.Value("string"),\r\n```\r\nInto:\r\n```python\r\n"id": datasets.Sequence(datasets.Value("string")),\r\n```\r\n\r\nShould fix your issue.\r\n\r\nLet me know if this helps!'
 'It seems to be working now, thanks a lot for the help, @SBrandeis !'
 "Glad to hear it!\r\nI'm closing the issue"]
Hi everyone,
Can anyone help me with why the dataset loading script below raises a Windows Permission Error? I stuck quite closely to https://github.com/huggingface/datasets/blob/master/datasets/conll2003/conll2003.py , only I want to load the data from three local three-column tsv-files (id\ttokens\tpos_tags\n). I am using the most recent version of datasets. Thank you in advance!
Luisa

My script:
```
import datasets
import csv

logger = datasets.logging.get_logger(__name__)


class SampleConfig(datasets.BuilderConfig):

    def __init__(self, **kwargs):
        super(SampleConfig, self).__init__(**kwargs)


class Sample(datasets.GeneratorBasedBuilder):
    BUILDER_CONFIGS = [
        SampleConfig(name="conll2003", version=datasets.Version("1.0.0"), description="Conll2003 dataset"),
    ]

    def _info(self):
        return datasets.DatasetInfo(
            description="Dataset with words and their POS-Tags",
            features=datasets.Features(
                {
                    "id": datasets.Value("string"),
                    "tokens": datasets.Sequence(datasets.Value("string")),
                    "pos_tags": datasets.Sequence(
                        datasets.features.ClassLabel(
                            names=[
                                "''",
                                ",",
                                "-LRB-",
                                "-RRB-",
                                ".",
                                ":",
                                "CC",
                                "CD",
                                "DT",
                                "EX",
                                "FW",
                                "HYPH",
                                "IN",
                                "JJ",
                                "JJR",
                                "JJS",
                                "MD",
                                "NN",
                                "NNP",
                                "NNPS",
                                "NNS",
                                "PDT",
                                "POS",
                                "PRP",
                                "PRP$",
                                "RB",
                                "RBR",
                                "RBS",
                                "RP",
                                "TO",
                                "UH",
                                "VB",
                                "VBD",
                                "VBG",
                                "VBN",
                                "VBP",
                                "VBZ",
                                "WDT",
                                "WP",
                                "WRB",
                                "``"
                            ]
                        )
                    ),
                }
            ),
            supervised_keys=None,
            homepage="https://catalog.ldc.upenn.edu/LDC2011T03",
            citation="Weischedel, Ralph, et al. OntoNotes Release 4.0 LDC2011T03. Web Download. Philadelphia: Linguistic Data Consortium, 2011.",
        )

    def _split_generators(self, dl_manager):
        loaded_files = dl_manager.download_and_extract(self.config.data_files)
        return [
            datasets.SplitGenerator(name=datasets.Split.TRAIN, gen_kwargs={"filepath": loaded_files["train"]}),
            datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": loaded_files["test"]}),
            datasets.SplitGenerator(name=datasets.Split.VALIDATION, gen_kwargs={"filepath": loaded_files["val"]})
        ]

    def _generate_examples(self, filepath):
        logger.info("generating examples from = %s", filepath)
        with open(filepath, encoding="cp1252") as f:
            data = csv.reader(f, delimiter="\t")
            ids = list()
            tokens = list()
            pos_tags = list()
            for id_, line in enumerate(data):
                #print(line)
                if len(line) == 1:
                    if tokens:
                        yield id_, {"id": ids, "tokens": tokens, "pos_tags": pos_tags}
                        ids = list()
                        tokens = list()
                        pos_tags = list()
                else:
                    ids.append(line[0])
                    tokens.append(line[1])
                    pos_tags.append(line[2])
            # last example
            yield id_, {"id": ids, "tokens": tokens, "pos_tags": pos_tags}


def main():
    dataset = datasets.load_dataset(
        "data_loading.py", data_files={
            "train": "train.tsv",
            "test": "test.tsv",
            "val": "val.tsv"
        }
    )

    #print(dataset)

if __name__=="__main__":
    main()
```

{'url': 'https://api.github.com/repos/huggingface/datasets/issues/2000/reactions', 'total_count': 0, '+1': 0, '-1': 0, 'laugh': 0, 'hooray': 0, 'confused': 0, 'heart': 0, 'rocket': 0, 'eyes': 0}