| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Signed-off-by: Mohammad Kalim Akram <kalim.akram@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size. |
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
|
||
| @classmethod | ||
| def mime_type(cls) -> str: | ||
| return 'application' |
There was a problem hiding this comment.
what is this mime type? use constants alsl
Sorry, something went wrong.
There was a problem hiding this comment.
This is a broad category for mimetypes. Contains obj, pdf, json, xml and many other files.. Now that I think about it, we should make it more specific (whatever is associated with .obj extension because that's what we usually use) and for other non-obj files rely on extra extensions. Changed accordingly.
Sorry, something went wrong.
| str(TOYDATA_DIR / 'hello.ogg'), | ||
| str(TOYDATA_DIR / 'hello.wma'), | ||
| str(TOYDATA_DIR / 'hello.aac'), | ||
| str(TOYDATA_DIR / 'hello'), |
There was a problem hiding this comment.
why removed?
Sorry, something went wrong.
There was a problem hiding this comment.
Because it's an Audio URL without an audio extension and should not be validated
Sorry, something went wrong.
There was a problem hiding this comment.
I am not sure about that, (at least on unix) i can store an audio file without extension I believe, why should that not be allowed? Admittedly, for audio it may not be common to do that, but text files do it, e.g. Dockerfile
Sorry, something went wrong.
There was a problem hiding this comment.
Yes you can, but in order to avoid issues like #1555 we need to look at extensions.
But you have a good point, text files without extensions are very common. Does it make sense to ignore validating text URLs that have no extensions? I don't really have another solution, we can't guess extensions or types in that scenario, and trying to read them during validation will be slow
Sorry, something went wrong.
There was a problem hiding this comment.
let's ignore validation of TextURL then?
Sorry, something went wrong.
There was a problem hiding this comment.
Can't we have a rule that is like "if there is an extension, validate it; if there is no extension, pass validation"? We could have that for all url types, no?
Sorry, something went wrong.
There was a problem hiding this comment.
"if there is an extension, validate it; if there is no extension, pass validation"
yeap this is what I meant, but for text urls only.
ok let's do it for all urls
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
| filename = url_parts[0].split('.') | ||
| extension = filename[-1] if len(filename) > 1 else None |
There was a problem hiding this comment.
maybe I am being overly cautious here, but do we know for a fact that there are no corner cases where this splitting into filename and extension could break? Is there some resource or standard that we can reference?
Alternatively, I think pydantic implements some of this internally, Maybe we could repurpose some of their logic?
Sorry, something went wrong.
There was a problem hiding this comment.
yeah there are many edge cases indeed. I already changed that part, can you take a look again? here are unit tests
https://github.com/docarray/docarray/pull/1669/files#diff-f1502e8b25d6058d51f22b4de5d853aeba8e107952a8b597848f8a918cb055fd
I'll explore how pydantic's doing that
Sorry, something went wrong.
There was a problem hiding this comment.
but I think this is ok for now, wdyt?
Sorry, something went wrong.
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
Signed-off-by: jupyterjazz <saba.sturua@jina.ai>
|
📝 Docs are deployed on https://ft-feat-file-validation--jina-docs.netlify.app 🎉 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Followup of #1606
Approach:
Why was CI failing in Kalim's PR:
Apparently mimetypes additionally uses system's mime.types file which is unique for different operating systems, even for different versions of the same operating system. Because of this file, mimetypes was guessing different types locally and on CI, resulting in strange errors. I disabled it by mimetypes.init([]) which means mimetypes will ignore system's mime.types and return same types every time