feat: make compatible based type with fastapi - #809
Merged
Conversation
samsja
marked this pull request as draft
November 17, 2022 16:10
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
* feat: add tensor type for ndarray * fix: fix mypy typing * feat: torch tensor type Signed-off-by: Johannes Messner <messnerjo@gmail.com> * fix: protobuf for pytorch type Signed-off-by: Johannes Messner <messnerjo@gmail.com> * ci: install all extras in the ci Signed-off-by: Johannes Messner <messnerjo@gmail.com> * refactor: make nice looking * docs: update docarray/typing/tensor/torch_tensor.py Co-authored-by: samsja <55492238+samsja@users.noreply.github.com> Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> * refactor: code style Signed-off-by: Johannes Messner <messnerjo@gmail.com> * fix: black and mypy Signed-off-by: Johannes Messner <messnerjo@gmail.com> * fix: suppress mypy import error * ci: fix ci install Signed-off-by: Johannes Messner <messnerjo@gmail.com> Signed-off-by: Johannes Messner <messnerjo@gmail.com> Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> Co-authored-by: samsja <55492238+samsja@users.noreply.github.com>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
samsja
force-pushed
the
feat-v2-fastapi-test
branch
from
November 17, 2022 17:04
a652aaa to
42c6fe4
Compare
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
samsja
force-pushed
the
feat-v2-fastapi-test
branch
from
November 18, 2022 14:23
3a894fa to
56497b9
Compare
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
samsja
force-pushed
the
feat-v2-fastapi-test
branch
from
November 22, 2022 13:43
100916c to
87bab05
Compare
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
samsja
force-pushed
the
feat-v2-fastapi-test
branch
from
November 22, 2022 13:50
87bab05 to
731feff
Compare
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
samsja
marked this pull request as ready for review
November 22, 2022 14:47
dongxiang123
approved these changes
Nov 22, 2022
JohannesMessner
requested changes
Nov 22, 2022
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Co-authored-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> Signed-off-by: samsja <55492238+samsja@users.noreply.github.com>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr>
JohannesMessner
approved these changes
Nov 23, 2022
dongxiang123
pushed a commit
that referenced
this pull request
Nov 23, 2022
* feat: allow da bulk access to return da for document Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: fix mypy type pb Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: add link to the mypy issue Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: remove useless list type hint Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * feat: torch tensor type (#800) * feat: add tensor type for ndarray * fix: fix mypy typing * feat: torch tensor type Signed-off-by: Johannes Messner <messnerjo@gmail.com> * fix: protobuf for pytorch type Signed-off-by: Johannes Messner <messnerjo@gmail.com> * ci: install all extras in the ci Signed-off-by: Johannes Messner <messnerjo@gmail.com> * refactor: make nice looking * docs: update docarray/typing/tensor/torch_tensor.py Co-authored-by: samsja <55492238+samsja@users.noreply.github.com> Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> * refactor: code style Signed-off-by: Johannes Messner <messnerjo@gmail.com> * fix: black and mypy Signed-off-by: Johannes Messner <messnerjo@gmail.com> * fix: suppress mypy import error * ci: fix ci install Signed-off-by: Johannes Messner <messnerjo@gmail.com> Signed-off-by: Johannes Messner <messnerjo@gmail.com> Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> Co-authored-by: samsja <55492238+samsja@users.noreply.github.com> * feat: add fastapi to dependency Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * feat(wip): add fake method to dump tensor to json Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * feat(wip): add fastapi test Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * feat: add json dump for type and document Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * feat: add json compatible with orjson Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * refactor: clean tests Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: remove duplicate Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: better json schema for tensor Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: fix fast api test Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * refactor: move to json test to integration Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: json laod from tensor type now working Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: add tensor to fastapi test Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: add new fastapi test Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: fix mypy Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * feat: add more testing for text uri about json Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: fix default orson not returning Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: apply johannes suggestion on docstring Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: does not perform copy anymore on torch tensor unwrap Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: add johannes suggestion Co-authored-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> Signed-off-by: samsja <55492238+samsja@users.noreply.github.com> * fix: fix ruff line lenght Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> * fix: fix mypy pb Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> Signed-off-by: Sami Jaghouar <sami.jaghouar@hotmail.fr> Signed-off-by: Johannes Messner <messnerjo@gmail.com> Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com> Signed-off-by: samsja <55492238+samsja@users.noreply.github.com> Co-authored-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context
The goal of this PR is make our Document model compatible with FastAPI.
What this PR do:
Mainly add json dump to types
allow to do
and it is working as well with our custom types