-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Rework of the URL subtraction feature #1392
base: master
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #1392 will not alter performanceComparing Summary
Benchmarks breakdown
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1392 +/- ##
==========================================
+ Coverage 96.05% 96.10% +0.05%
==========================================
Files 31 31
Lines 5751 5852 +101
Branches 342 350 +8
==========================================
+ Hits 5524 5624 +100
- Misses 201 202 +1
Partials 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
I'm going to do a 1.17.0 release so we can start preparing aiohttp 3.11.x and I want do to some more downstream cleanups. We can do a 1.18.0 for this once its ready |
Some conflicts happened. I think I've resolved them correctly |
|
||
>>> target = URL('http://example.com/path/index.html') | ||
>>> base = URL('http://example.com/') | ||
>>> target - base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also document what happens when you do base - target
?
assert result_url == expected_url | ||
|
||
|
||
@pytest.mark.xfail(reason="Empty segments are not preserved") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does need to be done to fix this? It'd be useful to include this information into the reason so that it's obvious when it can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is bugs to address - c.f. #1388 (comment)
("path/to", "spam/", "../path/to"), | ||
("path/../to", "path/", "../to"), | ||
("path/..", ".", "path/.."), | ||
("path/../replace/me", "path/../replace", "replace/me"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this different to the one below?
("path/../replace/me", "path/../replace/", "me"),
("http://example.com", "http://example.com/", "."), | ||
("//example.com", "//example.com", "."), | ||
("/path/to", "/spam/", "../path/to"), | ||
("path/to", "spam/", "../path/to"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no path
("/", "/to", ".."),
("/", "/path/to", "../.."),
normal
("/path", "/path/to", ".."),
trailing / - empy segment at the end
("/path", "/path/", ".."),
("/path", "/path/to/", "../.."),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c.f. #1388 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I support the intention I propose more conservative approach.
Let's provide a method, name it, instead of __sub__
operator overloading.
Add tests, doc, etc.
Publish new yarl
release, wait for feedback.
Tune and polish.
After some time we can return to adding __sub__
.
What do these changes do?
Rework of the URL subtraction feature (added in #1340; removed in #1391)
Are there changes in behavior for the user?
Being able to calculate the relative path between two URLs using the subtraction syntax:
Related issue number
Resolves #1183
Checklist
Known issues