Environment
- OS: Windows
- Python: 3.11.9
kaggle: 2.2.2
kagglesdk: 0.1.30
Command
Actual behavior
The command fails with:
not enough values to unpack (expected 2, got 1)
Expected behavior
kaggle quota should print the current accelerator quota table.
Likely cause
kagglesdk.kaggle_object.TimeDeltaSerializer._from_dict_value assumes protobuf duration strings always contain a fractional component:
(seconds, nanosRaw) = value.rstrip("s").split(".")
However, protobuf JSON duration strings may also be whole-second values such as:
When the quota API returns a whole-second duration, .split(".") returns one value and the command crashes.
Local patch that fixed it
I applied this local patch to TimeDeltaSerializer._from_dict_value, and kaggle quota started working:
raw_value = value.rstrip("s")
if "." not in raw_value:
return timedelta(seconds=int(raw_value))
(seconds, nanosRaw) = raw_value.split(".")
nanos = int(nanosRaw) * TimeDeltaSerializer.SUBSECOND_SCALING_FACTORS[len(nanosRaw)]
return timedelta(seconds=int(seconds), microseconds=int(int(nanos) / 1000))
Verification after patch
Both commands work after the local patch:
kaggle quota
kaggle quota --csv
Separate note
kaggle quota --help documents -v, --csv, but -v also exists as the global kaggle --version option. On my install, kaggle quota --csv is reliable, while kaggle quota -v does not behave the same way.
Environment
kaggle: 2.2.2kagglesdk: 0.1.30Command
Actual behavior
The command fails with:
Expected behavior
kaggle quotashould print the current accelerator quota table.Likely cause
kagglesdk.kaggle_object.TimeDeltaSerializer._from_dict_valueassumes protobuf duration strings always contain a fractional component:However, protobuf JSON duration strings may also be whole-second values such as:
When the quota API returns a whole-second duration,
.split(".")returns one value and the command crashes.Local patch that fixed it
I applied this local patch to
TimeDeltaSerializer._from_dict_value, andkaggle quotastarted working:Verification after patch
Both commands work after the local patch:
Separate note
kaggle quota --helpdocuments-v, --csv, but-valso exists as the globalkaggle --versionoption. On my install,kaggle quota --csvis reliable, whilekaggle quota -vdoes not behave the same way.