Skip to content

fix: use requests for upload (Sourcery refactored) #122

New issue

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

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

Already on GitHub? # to your account

Merged

Conversation

sourcery-ai[bot]
Copy link
Contributor

@sourcery-ai sourcery-ai bot commented Jan 17, 2022

Pull Request #121 refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the fix/use-requests-for-upload branch, then run:

git fetch origin sourcery/fix/use-requests-for-upload
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from leynier January 17, 2022 07:29
public_url = f"{self.url}/object/public/{_path}"
return public_url
return f"{self.url}/object/public/{_path}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function StorageFileAPI.get_public_url refactored with the following changes:

Comment on lines -146 to +145
body["prefix"] = path if path else ""
body["prefix"] = path or ""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Function StorageFileAPI.list refactored with the following changes:

@sourcery-ai
Copy link
Contributor Author

sourcery-ai bot commented Jan 17, 2022

Sourcery Code Quality Report

✅  Merging this PR will increase code quality in the affected files by 0.03%.

Quality metrics Before After Change
Complexity 2.91 ⭐ 2.94 ⭐ 0.03 👎
Method Length 48.60 ⭐ 48.20 ⭐ -0.40 👍
Working memory 6.99 🙂 6.95 🙂 -0.04 👍
Quality 78.21% 78.24% 0.03% 👍
Other metrics Before After Change
Lines 187 186 -1
Changed files Quality Before Quality After Quality Change
supabase/lib/storage/storage_file_api.py 78.21% ⭐ 78.24% ⭐ 0.03% 👍

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

File Function Complexity Length Working Memory Quality Recommendation

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!

@codecov
Copy link

codecov bot commented Jan 17, 2022

Codecov Report

Merging #122 (7392efd) into fix/use-requests-for-upload (ffdce41) will increase coverage by 0.17%.
The diff coverage is 0.00%.

Impacted file tree graph

@@                       Coverage Diff                       @@
##           fix/use-requests-for-upload     #122      +/-   ##
===============================================================
+ Coverage                        50.35%   50.53%   +0.17%     
===============================================================
  Files                                9        9              
  Lines                              284      283       -1     
===============================================================
  Hits                               143      143              
+ Misses                             141      140       -1     
Impacted Files Coverage Δ
supabase/lib/storage/storage_file_api.py 20.45% <0.00%> (+0.22%) ⬆️

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 ffdce41...7392efd. Read the comment docs.

@leynier leynier merged commit daa73c2 into fix/use-requests-for-upload Jan 17, 2022
@leynier leynier deleted the sourcery/fix/use-requests-for-upload branch January 17, 2022 13:46
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant