diff --git a/docarray/array/mixins/empty.py b/docarray/array/mixins/empty.py index 9959562fdbb..92a95f96624 100644 --- a/docarray/array/mixins/empty.py +++ b/docarray/array/mixins/empty.py @@ -10,11 +10,11 @@ class EmptyMixin: """Helper functions for building arrays with empty Document.""" @classmethod - def empty(cls: Type['T'], size: int = 0) -> 'T': + def empty(cls: Type['T'], size: int = 0, *args, **kwargs) -> 'T': """Create a :class:`DocumentArray` object with :attr:`size` empty :class:`Document` objects. :param size: the number of empty Documents in this container :return: a :class:`DocumentArray` object """ - return cls(Document() for _ in range(size)) + return cls((Document() for _ in range(size)), *args, **kwargs) diff --git a/docarray/array/mixins/io/binary.py b/docarray/array/mixins/io/binary.py index 3b7b772c1c6..32bcc194f34 100644 --- a/docarray/array/mixins/io/binary.py +++ b/docarray/array/mixins/io/binary.py @@ -168,7 +168,10 @@ def from_bytes( _show_progress: bool = False, ) -> 'T': return cls.load_binary( - data, protocol=protocol, compress=compress, _show_progress=_show_progress + data, + protocol=protocol, + compress=compress, + _show_progress=_show_progress, ) def save_binary( diff --git a/docarray/array/mixins/io/from_gen.py b/docarray/array/mixins/io/from_gen.py index e038b526ffb..2428e2e103e 100644 --- a/docarray/array/mixins/io/from_gen.py +++ b/docarray/array/mixins/io/from_gen.py @@ -36,6 +36,8 @@ def from_ndarray( axis: int = 0, size: Optional[int] = None, shuffle: bool = False, + *args, + **kwargs, ) -> 'T': """Build from a numpy array. diff --git a/docarray/array/mixins/io/pushpull.py b/docarray/array/mixins/io/pushpull.py index 4461bffee3b..e6c5df8aa70 100644 --- a/docarray/array/mixins/io/pushpull.py +++ b/docarray/array/mixins/io/pushpull.py @@ -90,11 +90,7 @@ def read(self, n=-1): ) @classmethod - def pull( - cls: Type['T'], - token: str, - show_progress: bool = False, - ) -> 'T': + def pull(cls: Type['T'], token: str, show_progress: bool = False) -> 'T': """Pulling a :class:`DocumentArray` from Jina Cloud Service to local. :param token: the upload token set during :meth:`.push` diff --git a/docarray/array/mixins/pydantic.py b/docarray/array/mixins/pydantic.py index 7673aba5133..d3fa3df478a 100644 --- a/docarray/array/mixins/pydantic.py +++ b/docarray/array/mixins/pydantic.py @@ -22,10 +22,7 @@ def to_pydantic_model(self) -> 'PydanticDocumentArray': return [d.to_pydantic_model() for d in self] @classmethod - def from_pydantic_model( - cls: Type['T'], - model: List['BaseModel'], - ) -> 'T': + def from_pydantic_model(cls: Type['T'], model: List['BaseModel']) -> 'T': """Convert a list of PydanticDocument into :param model: the pydantic data model object that represents a DocumentArray