Closed yellowdolphin closed 8 months ago
Hi @yellowdolphin - dataset_list_files
requires a /
because the dataset is referred to by username/dataset_name
. The CONFIG_NAME_USER
refers to the current user but isn't assumed to be the owner of the dataset, since you may want to pull data from other users.
ValueError: not enough values to unpack (expected 3, got 2)
How to reproduce/Test:
(1) Ensure the KaggleApi instance has
CONFIG_NAME_USER
and version == '1.6.2' (2) Call API functionsdataset_list_files
ordataset_download_files
with a bare dataset name.For instance
Cause:
kaggle_api_extended.split_dataset_string
returns a tuple of 2 ifdataset
contains no '/'.The method is called by two other methods in class KaggleApi (
dataset_list_files
anddataset_download_files
), both of which break trying to unpack a tuple of 3:Fix:
Might be to return
None
as 3rd value. This happens also whendataset
contains a single '/'.Also:
With this fix,
split_dataset_string
could be called also indataset_download_file
to get rid of the redundant code there.(I'm not familiar with swagger, so I will not make a pull request)