Skip to content

pycharm does not detect proprety from DocumentArray #1174

@samsja

Description

@samsja
from docarray import BaseDocument, DocumentArray
from docarray.typing import TorchTensor

import torch

class Image(BaseDocument):
    tensor: TorchTensor[3, 224, 224]

batch = DocumentArray[Image](
    [Image(tensor=torch.zeros(3, 224, 224)) for _ in range(10)]
)

batch.tensor # here pycahrm will complain

With Document (and pydantic) we don't have this problem
Screenshot from 2023-03-15 10-43-15

We need to find a way (like in pandas) so that pycharm and other tool does not complain

Metadata

Metadata

Labels

good-first-issueSuitable as your first contribution to DocArray!

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions