Skip to content

feat: text url type#814

Merged
samsja merged 27 commits into
feat-rewrite-v2from
feat-text-url
Nov 21, 2022
Merged

feat: text url type#814
samsja merged 27 commits into
feat-rewrite-v2from
feat-text-url

Conversation

@JohannesMessner

Copy link
Copy Markdown
Member

Goals:

Add type TextUrl that can .load() local or remote files to str or bytes:

class MyDoc(Document):
    remote_url: TextUrl
    local_url: TextUrl


doc = MyDoc(
    remote_url='https://de.wikipedia.org/wiki/Brixen',
    local_url='/home/johannes/Documents/jina/docarrayv2/tests/toydata/penal_colony.txt'
)

remote_txt = doc.remote_url.load()
print(remote_txt)
# prints: ```<!DOCTYPE html>\n<html class="client-nojs" lang="de" dir="ltr"> ...```

local_txt = doc.local_url.load()
print(local_txt)

JohannesMessner and others added 26 commits November 11, 2022 16:10
…tte-v2

# Conflicts:
#	docarray/document/mixins/proto.py
#	docarray/typing/ndarray.py
#	docarray/typing/tensor/__init__.py
#	docarray/typing/tensor/tensor.py
#	docarray/typing/url/image_url.py
#	tests/integrations/typing/tensor.py
#	tests/units/document/proto/test_proto_based_object.py
#	tests/units/typing/test_image_url.py
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Co-authored-by: samsja <55492238+samsja@users.noreply.github.com>
Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
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>
Signed-off-by: Johannes Messner <messnerjo@gmail.com>
@dongxiang123

Copy link
Copy Markdown
Contributor

If you are having text_url and image_url, is it possible for us to have video_url as well ?

@JohannesMessner

JohannesMessner commented Nov 21, 2022

Copy link
Copy Markdown
Member Author

If you are having text_url and image_url, is it possible for us to have video_url as well ?

Yes, planned for alpha-v0.2.0, see here

Signed-off-by: Johannes Messner <44071807+JohannesMessner@users.noreply.github.com>
@samsja samsja merged commit 3cda27b into feat-rewrite-v2 Nov 21, 2022
@samsja samsja deleted the feat-text-url branch November 21, 2022 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants