nested sequence feature won't encode example if the first item of the outside sequence is an empty list
NONE
knock knock
2021-12-06T17:22:58Z
https://github.com/huggingface/datasets/issues/3306#issuecomment-986988311
https://api.github.com/repos/huggingface/datasets/issues/3306
IC_kwDODunzps461D8X
https://api.github.com/repos/huggingface/datasets/issues/comments/986988311/reactions
2021-12-06T17:22:58Z
https://api.github.com/repos/huggingface/datasets/issues/comments/986988311
https://avatars.githubusercontent.com/u/38486514?v=4
https://api.github.com/users/function2-llx/events{/privacy}
https://api.github.com/users/function2-llx/followers
https://api.github.com/users/function2-llx/following{/other_user}
https://api.github.com/users/function2-llx/gists{/gist_id}
https://github.com/function2-llx
function2-llx
MDQ6VXNlcjM4NDg2NTE0
https://api.github.com/users/function2-llx/orgs
https://api.github.com/users/function2-llx/received_events
https://api.github.com/users/function2-llx/repos
https://api.github.com/users/function2-llx/starred{/owner}{/repo}
https://api.github.com/users/function2-llx/subscriptions
User
https://api.github.com/users/function2-llx
public
COLLABORATOR
Hi, thanks for reporting! I've linked a PR that should fix the issue.
2021-12-07T17:49:52Z
https://github.com/huggingface/datasets/issues/3306#issuecomment-988143665
https://api.github.com/repos/huggingface/datasets/issues/3306
IC_kwDODunzps465eAx
https://api.github.com/repos/huggingface/datasets/issues/comments/988143665/reactions
2021-12-07T17:49:52Z
https://api.github.com/repos/huggingface/datasets/issues/comments/988143665
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
NONE
I've checked the PR and it looks great, thanks a lot!
2021-12-08T11:14:31Z
https://github.com/huggingface/datasets/issues/3306#issuecomment-988721134
https://api.github.com/repos/huggingface/datasets/issues/3306
IC_kwDODunzps467q_u
https://api.github.com/repos/huggingface/datasets/issues/comments/988721134/reactions
2021-12-08T11:14:31Z
https://api.github.com/repos/huggingface/datasets/issues/comments/988721134
https://avatars.githubusercontent.com/u/38486514?v=4
https://api.github.com/users/function2-llx/events{/privacy}
https://api.github.com/users/function2-llx/followers
https://api.github.com/users/function2-llx/following{/other_user}
https://api.github.com/users/function2-llx/gists{/gist_id}
https://github.com/function2-llx
function2-llx
MDQ6VXNlcjM4NDg2NTE0
https://api.github.com/users/function2-llx/orgs
https://api.github.com/users/function2-llx/received_events
https://api.github.com/users/function2-llx/repos
https://api.github.com/users/function2-llx/starred{/owner}{/repo}
https://api.github.com/users/function2-llx/subscriptions
User
https://api.github.com/users/function2-llx
public
## Describe the bug
As the title, nested sequence feature won't encode example if the first item of the outside sequence is an empty list.

## Steps to reproduce the bug
```python
from datasets import Features, Sequence, ClassLabel
features = Features({
    'x': Sequence(Sequence(ClassLabel(names=['a', 'b']))),
})
print(features.encode_batch({
    'x': [
        [['a'], ['b']],
        [[], ['b']],
    ]
}))
```

## Expected results
print `{'x': [[[0], [1]], [[], ['1']]]}`

## Actual results
print `{'x': [[[0], [1]], [[], ['b']]]}`

## Environment info
- `datasets` version: 1.15.1
- Platform: Linux-5.13.0-21-generic-x86_64-with-glibc2.34
- Python version: 3.9.7
- PyArrow version: 6.0.0

## Additional information
I think the issue stems from [here](https://github.com/huggingface/datasets/blob/8555197a3fe826e98bd0206c2d031c4488c53c5c/src/datasets/features/features.py#L847-L848).

