GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: validate file formats in url by makram93 · Pull Request #1606 · docarray/docarray

This repository was archived by the owner on Sep 9, 2026. It is now read-only.

Conversation

@makram93

@makram93 makram93 commented May 31, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Solves: #1555

Solution:

  • rely on the mime-types library to detect the mime type from the URL and raise an error if it is not the expected type for that class
  • if auto-detection of mime-type fails then we check if the file ending is among the extra extensions
    • Check for exceptional cases, if there is still no match then raise the error

CAVEAT: Any file without an extension will raise an error, for example, a wav audio file with no extension will raise an error.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@makram93
fix: validate file formats in url
5243e23
Signed-off-by: Mohammad Kalim Akram <[email protected]>
@makram93 makram93 changed the title fix: validate file formats in url feat: validate file formats in url May 31, 2023
@JoanFM

JoanFM commented May 31, 2023

Copy link
Copy Markdown
Member

I think doing a request to the URL is an overkill and it will make it very slow

makram93 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JoanFM
JoanFM suggested changes May 31, 2023
View reviewed changes
Comment thread docarray/typing/url/any_url.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JoanFM JoanFM linked an issue Jun 14, 2023 that may be closed by this pull request
Url types are not aware of extension during validation #1555
Closed
makram93 and others added 3 commits June 23, 2023 03:11
@makram93
Merge branch 'docarray:main' into feat-file-format-validation
7e52fff
@makram93
fix: apply review suggestions
aa07312
Signed-off-by: Mohammad Kalim Akram <[email protected]>
@makram93
fix: mypy and unit tests
a7f515d
Signed-off-by: Mohammad Kalim Akram <[email protected]>
@jupyterjazz
jupyterjazz changed the base branch from main to feat-file-validation June 26, 2023 08:59
@jupyterjazz
jupyterjazz requested a review from JoanFM June 26, 2023 09:02
JoanFM
JoanFM approved these changes Jun 26, 2023
View reviewed changes
@jupyterjazz
jupyterjazz marked this pull request as ready for review June 26, 2023 09:07
@jupyterjazz
jupyterjazz merged commit 49fd592 into docarray:feat-file-validation Jun 26, 2023
@jupyterjazz jupyterjazz mentioned this pull request Jun 26, 2023
feat: validate file formats in url (#1606) #1669
Merged
JoanFM pushed a commit that referenced this pull request Jun 27, 2023
@jupyterjazz @makram93
feat: validate file formats in url (#1606) (#1669)
e0e5cd8
Signed-off-by: Mohammad Kalim Akram <[email protected]>
Signed-off-by: jupyterjazz <[email protected]>
Co-authored-by: Mohammad Kalim Akram <[email protected]>
@JoanFM JoanFM mentioned this pull request Jul 3, 2023
Release Notes v0.35.0 #1683
Closed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

1 more reviewer
@JoanFM JoanFM JoanFM approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Url types are not aware of extension during validation

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@makram93 @JoanFM @jupyterjazz
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.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.