activeloopai / activeloopai/deeplake

[Improvement] Make index errors while accessing Dataset and Tensor easier to understand.

未關閉
#1,560 9 則留言 0 個 reaction 已指派 1 人 已被 @Moksh45 認領 在 GitHub 檢視
主要語言
C++
星號
9.2k
分支
722
PR 合併指標
30 天內沒有已合併 PR

描述

## 🚨🚨 Feature Request

- [x] A new implementation (Improvement, Extension)

### Is your feature request related to a problem?

Currently, if a user tries to access an index that is larger than the dataset length or tensor length, an internal error is thrown which is not easy to understand.

### Description of the possible solution

We can catch the error and throw a more descriptive error that's easier to understand.

Example of when the error is thrown:-

```python
ds = hub.dataset("path/to/dataset")
ds.create_tensor("xyz")
for i in range(10):
ds.xyz.append(i)

# now length of xyz and ds is 10

ds[20] # throws error
ds.xyz[89] # throws error
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。