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

Small cleanups for the new subtraction operator #1384

Closed
wants to merge 4 commits into from

Conversation

oleksbabieiev
Copy link
Contributor

What do these changes do?

Small cleanups for the new subtraction operator.

Are there changes in behavior for the user?

N/A

Related issue number

Resolves #1377

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes

@oleksbabieiev oleksbabieiev changed the title Relpath cleanup Small cleanups for the new subtraction operator Oct 23, 2024
Copy link

codecov bot commented Oct 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.06%. Comparing base (3a14e46) to head (dfb457e).
Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1384   +/-   ##
=======================================
  Coverage   96.05%   96.06%           
=======================================
  Files          31       31           
  Lines        5752     5765   +13     
  Branches      360      361    +1     
=======================================
+ Hits         5525     5538   +13     
  Misses        201      201           
  Partials       26       26           
Flag Coverage Δ
CI-GHA 96.06% <100.00%> (+<0.01%) ⬆️
MyPy 46.05% <64.70%> (+0.09%) ⬆️
OS-Linux 99.55% <100.00%> (+<0.01%) ⬆️
OS-Windows 99.61% <100.00%> (+<0.01%) ⬆️
OS-macOS 99.30% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 99.28% <100.00%> (+<0.01%) ⬆️
Py-3.10.15 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.11.10 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 99.28% <100.00%> (+<0.01%) ⬆️
Py-3.12.7 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.13.0 99.51% <100.00%> (+<0.01%) ⬆️
Py-3.9.13 99.23% <100.00%> (+<0.01%) ⬆️
Py-3.9.20 99.47% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.16 99.52% <100.00%> (+<0.01%) ⬆️
Py-pypy7.3.17 99.55% <100.00%> (+<0.01%) ⬆️
VM-macos-latest 99.30% <100.00%> (+<0.01%) ⬆️
VM-ubuntu-latest 99.55% <100.00%> (+<0.01%) ⬆️
VM-windows-latest 99.61% <100.00%> (+<0.01%) ⬆️
pytest 99.55% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

codspeed-hq bot commented Oct 23, 2024

CodSpeed Performance Report

Merging #1384 will not alter performance

Comparing oleksbabieiev:relpath-cleanup (dfb457e) with master (3a14e46)

Summary

✅ 84 untouched benchmarks

tests/test_url.py Outdated Show resolved Hide resolved
tests/test_url.py Outdated Show resolved Hide resolved
@bdraco
Copy link
Member

bdraco commented Oct 24, 2024

FAILED tests/test_url.py::test_sub_combined_with_join - hypothesis.errors.FailedHealthCheck: Data generation is extremely slow: Only produced 9 valid examples in 1.05 seconds (0 invalid ones and 7 exceeded maximum size). Try decreasing size of the data you're generating (with e.g. max_size or max_leaves parameters).

It looks like its failing on performance. The performance is nearly quadratic unfortunately so any long paths are going to be very slow.

@bdraco
Copy link
Member

bdraco commented Oct 25, 2024

I tried to solve the performance issues in #1388, however in the process I became aware that there are other considerations that are missing.

Its clear this isn't ready to go yet and I merged #1340 too soon (apologies to everyone involved) so I've opened up #1391 to revert it so we can start over with a new approach.

I'm not sure if #1388 is the way to go or not but if it is, its probably a good start as its looks like using the built-in path logic in Python is going to be a non-starter and its likely we need to implement it ourselves since the built-in path logic doesn't translate well for URLs as the requirements have subtle differences.

@bdraco
Copy link
Member

bdraco commented Oct 25, 2024

Apologizes for not noticing the issues before merging #1340. I sincerely hope that will not dissuade a second attempt.

@webknjaz
Copy link
Member

Side note: it would probably be useful to have own hypothesis strategy under yarl.testing that could be utilized both within yarl's own test suite and any downstream/end-user projects. That strategy would need to produce various URL edge cases.
This is not in the scope of this PR, however, I just wanted to record the idea.

@oleksbabieiev
Copy link
Contributor Author

Well, I think it would make sense if I create a new pull request to rework this feature @bdraco

@oleksbabieiev
Copy link
Contributor Author

#1392

@oleksbabieiev oleksbabieiev deleted the relpath-cleanup branch October 25, 2024 17:45
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.

Small cleanups for the new subtraction operator
3 participants