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

feat: refactor existing methods to use newer request #394

Merged
merged 19 commits into from
Oct 17, 2021

Conversation

browniebroke
Copy link
Owner

@browniebroke browniebroke commented Oct 15, 2021

Impacted issues:

Summary of changes:

  • Refactor all client methods to use request
  • Refactor all resource methods to use request
  • Update AsyncClient to implement request and work with it
  • Update all tests
  • Merge search and advanced search
  • Remove resources that no longer exist: Comment

BREAKING CHANGE: A `DeezerErrorResponse` is now raised in case of error, instead of `ValueError`
BREAKING CHANGE: The `Client.get_genres` method has been removed and replaced by `Client.list_genres`
BREAKING CHANGE: The `Client.get_radios` method has been removed and replaced by `Client.list_radios`
@codecov
Copy link

codecov bot commented Oct 16, 2021

Codecov Report

Merging #394 (e643052) into main (5f3910e) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #394   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            5         5           
  Lines          298       310   +12     
  Branches        27        31    +4     
=========================================
+ Hits           298       310   +12     
Impacted Files Coverage Δ
deezer/__init__.py 100.00% <ø> (ø)
deezer/client.py 100.00% <100.00%> (ø)
deezer/contrib/tornado.py 100.00% <100.00%> (ø)
deezer/exceptions.py 100.00% <100.00%> (ø)
deezer/resources.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5f3910e...e643052. Read the comment docs.

@browniebroke browniebroke marked this pull request as ready for review October 17, 2021 10:54
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Oct 17, 2021

Sourcery Code Quality Report

❌  Merging this PR will decrease code quality in the affected files by 0.18%.

Quality metrics Before After Change
Complexity 0.82 ⭐ 1.03 ⭐ 0.21 👎
Method Length 28.28 ⭐ 27.96 ⭐ -0.32 👍
Working memory 4.41 ⭐ 4.46 ⭐ 0.05 👎
Quality 89.79% 89.61% -0.18% 👎
Other metrics Before After Change
Lines 1616 1738 122
Changed files Quality Before Quality After Quality Change
conftest.py 96.46% ⭐ 90.62% ⭐ -5.84% 👎
deezer/init.py 80.98% ⭐ 83.52% ⭐ 2.54% 👍
deezer/client.py 83.66% ⭐ 81.59% ⭐ -2.07% 👎
deezer/exceptions.py 87.48% ⭐ 88.03% ⭐ 0.55% 👍
deezer/resources.py 94.93% ⭐ 94.77% ⭐ -0.16% 👎
deezer/contrib/tornado.py 83.09% ⭐ 76.61% ⭐ -6.48% 👎
tests/test_client.py 94.70% ⭐ 94.42% ⭐ -0.28% 👎
tests/test_resources.py 86.75% ⭐ 88.25% ⭐ 1.50% 👍
tests/test_tornado_client.py 92.58% ⭐ 94.10% ⭐ 1.52% 👍

Here are some functions in these files that still need a tune-up:

File Function Complexity Length Working Memory Quality Recommendation
deezer/client.py Client._process_json 13 🙂 110 🙂 10 😞 55.28% 🙂 Extract out complex expressions
deezer/client.py Client._search 9 🙂 98 🙂 11 😞 58.59% 🙂 Extract out complex expressions
deezer/client.py Client.search 0 ⭐ 62 🙂 16 ⛔ 65.59% 🙂 Extract out complex expressions
tests/test_client.py TestClient.test_process_json_types 0 ⭐ 130 😞 7 🙂 71.78% 🙂 Try splitting into smaller methods
deezer/exceptions.py DeezerHTTPError.__init__ 3 ⭐ 49 ⭐ 10 😞 73.66% 🙂 Extract out complex expressions

Legend and Explanation

The emojis denote the absolute quality of the code:

  • ⭐ excellent
  • 🙂 good
  • 😞 poor
  • ⛔ very poor

The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request.


Please see our documentation here for details on how these metrics are calculated.

We are actively working on this report - lots more documentation and extra metrics to come!

Help us improve this quality report!

@browniebroke browniebroke merged commit 6bb0647 into main Oct 17, 2021
@browniebroke browniebroke deleted the removal/get-object branch October 17, 2021 11:27
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.

Replace usages of Client.get_object by Client.request
1 participant