Skip to content

feat: add-response-model #64

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

Merged
merged 30 commits into from
Jan 28, 2022
Merged

feat: add-response-model #64

merged 30 commits into from
Jan 28, 2022

Conversation

dreinon
Copy link
Contributor

@dreinon dreinon commented Jan 3, 2022

No description provided.

@dreinon dreinon requested review from anand2312, J0 and leynier January 3, 2022 15:57
@dreinon dreinon marked this pull request as ready for review January 4, 2022 17:53
Copy link
Contributor

@anand2312 anand2312 left a comment

Choose a reason for hiding this comment

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

A quick first review, a few return annotations are missing

@codecov
Copy link

codecov bot commented Jan 4, 2022

Codecov Report

Merging #64 (11399b9) into master (e190621) will increase coverage by 1.45%.
The diff coverage is 89.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #64      +/-   ##
==========================================
+ Coverage   88.62%   90.08%   +1.45%     
==========================================
  Files          21       22       +1     
  Lines         686      867     +181     
==========================================
+ Hits          608      781     +173     
- Misses         78       86       +8     
Impacted Files Coverage Δ
postgrest_py/exceptions.py 43.47% <43.47%> (ø)
postgrest_py/_sync/request_builder.py 88.88% <60.00%> (-6.24%) ⬇️
postgrest_py/_async/request_builder.py 89.13% <63.63%> (-6.00%) ⬇️
postgrest_py/_async/client.py 73.52% <100.00%> (ø)
postgrest_py/base_request_builder.py 76.04% <100.00%> (+11.46%) ⬆️
tests/_async/test_request_builder.py 100.00% <100.00%> (ø)
tests/_sync/test_request_builder.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 e190621...11399b9. Read the comment docs.

@dreinon dreinon requested a review from leynier January 9, 2022 01:10
@J0 J0 mentioned this pull request Jan 15, 2022
* initial commit

* tests: add fixtures for APIResponse

* tests: [WIP] Test methods that don't interact with RequestResponse

* tests: replace builtin type by typing type and add type annotations

* tests: add requests Response fixtures

* chore: change return order to improve readability

* tests: add tests for left methods

Co-authored-by: Joel Lee <[email protected]>
Co-authored-by: Dani Reinón <[email protected]>
@dreinon dreinon force-pushed the add-response-model branch from 6233ae7 to 2df9d14 Compare January 27, 2022 23:22
@dreinon dreinon requested review from anand2312 and lqmanh January 27, 2022 23:24
Copy link
Contributor

@anand2312 anand2312 left a comment

Choose a reason for hiding this comment

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

This looks good to me 🚀
Nitpick: What do you think about making the classmethods/staticmethods on the APIResponse private (adding a leading _)

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 28, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.51 ⭐ 0.30 ⭐ -0.21 👍
Method Length 27.16 ⭐ 23.89 ⭐ -3.27 👍
Working memory 5.41 ⭐ 4.96 ⭐ -0.45 👍
Quality 89.43% 91.36% 1.93% 👍
Other metrics Before After Change
Lines 691 1032 341
Changed files Quality Before Quality After Quality Change
postgrest_py/base_request_builder.py 86.70% ⭐ 88.74% ⭐ 2.04% 👍
postgrest_py/_async/client.py 92.94% ⭐ 92.94% ⭐ 0.00%
postgrest_py/_async/request_builder.py 88.17% ⭐ 88.32% ⭐ 0.15% 👍
postgrest_py/_sync/request_builder.py 88.18% ⭐ 88.35% ⭐ 0.17% 👍
tests/_async/test_request_builder.py 92.64% ⭐ 93.99% ⭐ 1.35% 👍
tests/_sync/test_request_builder.py 92.64% ⭐ 93.99% ⭐ 1.35% 👍

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

File Function Complexity Length Working Memory Quality Recommendation
tests/_async/test_request_builder.py request_response_with_data 0 ⭐ 31 ⭐ 10 😞 79.58% ⭐ Extract out complex expressions
tests/_sync/test_request_builder.py request_response_with_data 0 ⭐ 31 ⭐ 10 😞 79.58% ⭐ 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!

@dreinon
Copy link
Contributor Author

dreinon commented Jan 28, 2022

This looks good to me 🚀
Nitpick: What do you think about making the classmethods/staticmethods on the APIResponse private (adding a leading _)

@anand2312 Done!

@dreinon dreinon merged commit 07ef4d4 into master Jan 28, 2022
@dreinon dreinon changed the title Add-response-model feat: add-response-model Jan 28, 2022
@anand2312 anand2312 deleted the add-response-model branch April 13, 2022 17:42
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