Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docarray/array/mixins/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ def to_protobuf(self) -> 'DocumentArrayProto':
dap.docs.append(doc.to_protobuf())
return dap

def _to_nested_item_protobuf(self) -> 'NodeProto':
"""Convert a DocumentArray into a nested item protobuf message.
def _to_node_protobuf(self) -> NodeProto:
"""Convert a DocumentArray into a NodeProto protobuf message.
This function should be called when a DocumentArray
is nested into another Document that need to be converted into a protobuf

Expand Down
4 changes: 2 additions & 2 deletions docarray/document/base_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class BaseNode(ABC):
"""

@abstractmethod
def _to_nested_item_protobuf(self) -> 'NodeProto':
"""Convert itself into a nested item protobuf message. This function should
def _to_node_protobuf(self) -> NodeProto:
"""Convert itself into a NodeProto message. This function should
be called when the self is nested into another Document that need to be
converted into a protobuf

Expand Down
6 changes: 3 additions & 3 deletions docarray/document/mixins/proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def to_protobuf(self) -> 'DocumentProto':
for field, value in self:
try:
if isinstance(value, BaseNode):
nested_item = value._to_nested_item_protobuf()
nested_item = value._to_node_protobuf()

elif type(value) is str:
nested_item = NodeProto(text=value)
Expand Down Expand Up @@ -91,8 +91,8 @@ def to_protobuf(self) -> 'DocumentProto':

return DocumentProto(data=data)

def _to_nested_item_protobuf(self) -> 'NodeProto':
"""Convert Document into a nested item protobuf message. This function should be
def _to_node_protobuf(self) -> NodeProto:
"""Convert Document into a NodeProto protobuf message. This function should be
called when the Document is nest into another Document that need to be
converted into a protobuf

Expand Down
6 changes: 3 additions & 3 deletions docarray/typing/tensor/tensor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union, TypeVar, Any, TYPE_CHECKING, Type, cast
from typing import TYPE_CHECKING, Any, Type, TypeVar, Union, cast

import numpy as np

Expand Down Expand Up @@ -40,8 +40,8 @@ def validate(
def from_ndarray(cls: Type[T], value: np.ndarray) -> T:
return value.view(cls)

def _to_nested_item_protobuf(self: T) -> 'NodeProto':
"""Convert Document into a nested item protobuf message. This function should
def _to_node_protobuf(self: T) -> NodeProto:
"""Convert Document into a NodeProto protobuf message. This function should
be called when the Document is nested into another Document that need to be
converted into a protobuf

Expand Down
4 changes: 2 additions & 2 deletions docarray/typing/url/any_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@


class AnyUrl(BaseAnyUrl, BaseNode):
def _to_nested_item_protobuf(self) -> 'NodeProto':
"""Convert Document into a nested item protobuf message. This function should
def _to_node_protobuf(self) -> NodeProto:
"""Convert Document into a NodeProto protobuf message. This function should
be called when the Document is nested into another Document that need to
be converted into a protobuf

Expand Down