Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: S3 paths with fragments not working #2156

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saikonen
Copy link
Collaborator

S3 paths with url fragments do not work with the Metaflow S3 client, but do work with boto3 directly. The cause is that any key we pass to S3 methods goes through urlparse, of which we only use netloc and path. Fragments get parsed into their own key in the ParseResult.

@nflx-mf-bot
Copy link
Collaborator

Testing[901] @ ab60275

@nflx-mf-bot
Copy link
Collaborator

Testing[901] @ ab60275 had 5 FAILUREs.

@romain-intel
Copy link
Contributor

I'll check. I suspect it's some flaky tests (we have been having a few that I haven't fixed yet).

@@ -600,7 +600,7 @@ def _url(self, key_value):
# returned are Unicode.
key = getattr(key_value, "key", key_value)
if self._s3root is None:
parsed = urlparse(to_unicode(key))
parsed = urlparse(to_unicode(key), allow_fragments=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add a comment here calling out why allow_fragments needs to be set to False for posterity

Copy link
Collaborator

@savingoyal savingoyal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with a minor nit

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.

4 participants