Skip to content

Commit 1d44f27

Browse files
Joan FontanalsJoanFM
authored andcommitted
Merge branch 'master' into fix-6140
Signed-off-by: Joan Martinez <[email protected]>
2 parents 30b37f2 + 7fbbfcf commit 1d44f27

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,7 @@ Jina is released on every Friday evening. The PyPi package and Docker Image will
655655
- [Release Note (`3.23.0`)](#release-note-3230)
656656
- [Release Note (`3.23.1`)](#release-note-3231)
657657
- [Release Note (`3.23.2`)](#release-note-3232)
658+
- [Release Note (`3.23.3`)](#release-note-3233)
658659

659660
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
660661

tests/unit/serve/runtimes/test_helper.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,3 +382,28 @@ class SearchResult(BaseDoc):
382382
reconstructed_in_gateway_from_Search_results = QuoteFile_reconstructed_in_gateway_from_Search_results(
383383
texts=textlist)
384384
assert reconstructed_in_gateway_from_Search_results.texts[0].text == 'hey'
385+
386+
387+
@pytest.mark.skipif(not docarray_v2, reason='Test only working with docarray v2')
388+
def test_create_aux_model_with_multiple_doclists_of_same_type():
389+
from docarray import DocList, BaseDoc
390+
from jina.serve.runtimes.helper import _create_aux_model_doc_list_to_list
391+
392+
class MyTextDoc(BaseDoc):
393+
text: str
394+
395+
class QuoteFile(BaseDoc):
396+
texts: DocList[MyTextDoc]
397+
398+
class QuoteFileType(BaseDoc):
399+
"""
400+
QuoteFileType class.
401+
"""
402+
id: str = None # same as name, compatibility reasons for a generic, shared `id` field
403+
name: str = None
404+
total_count: int = None
405+
docs: DocList[QuoteFile] = None
406+
chunks: DocList[QuoteFile] = None
407+
408+
new_model = _create_aux_model_doc_list_to_list(QuoteFileType)
409+
new_model.schema()

0 commit comments

Comments
 (0)