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

Fix sanitize_params to correctly resolve nested columns #222

Merged
merged 4 commits into from
Feb 25, 2023

Conversation

guillego
Copy link
Contributor

What kind of change does this PR introduce?

Bug fix

What is the current behavior?

Nested columns (of the form foreign_table.column) are currently escaped which breaks the API exposed by postgrest.

#189
#202

What is the new behavior?

This PR modifies the sanitize_parameters() function so that the . character is not escaped anymore.
It also adds some test to verify this behavior.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Feb 21, 2023

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.07 ⭐ 0.06 ⭐ -0.01 👍
Method Length 25.32 ⭐ 26.41 ⭐ 1.09 👎
Working memory 3.16 ⭐ 3.33 ⭐ 0.17 👎
Quality 96.25% 95.74% -0.51% 👎
Other metrics Before After Change
Lines 134 168 34
Changed files Quality Before Quality After Quality Change
postgrest/utils.py 95.25% ⭐ 95.25% ⭐ 0.00%
tests/_async/test_filter_request_builder.py 96.38% ⭐ 95.79% ⭐ -0.59% 👎
tests/_sync/test_filter_request_builder.py 96.38% ⭐ 95.79% ⭐ -0.59% 👎

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 Feb 22, 2023

Codecov Report

Base: 91.37% // Head: 91.51% // Increases project coverage by +0.14% 🎉

Coverage data is based on head (8db468f) compared to base (ea579fd).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #222      +/-   ##
==========================================
+ Coverage   91.37%   91.51%   +0.14%     
==========================================
  Files          23       24       +1     
  Lines        1148     1167      +19     
==========================================
+ Hits         1049     1068      +19     
  Misses         99       99              
Impacted Files Coverage Δ
postgrest/utils.py 93.33% <100.00%> (ø)
tests/_async/test_filter_request_builder.py 100.00% <100.00%> (ø)
tests/_sync/test_filter_request_builder.py 100.00% <100.00%> (ø)
tests/test_utils.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@guillego
Copy link
Contributor Author

@J0 let me know if there's anything else to do here! 😄

@J0
Copy link
Contributor

J0 commented Feb 24, 2023

@guillego, Thanks for your patience - nothing on your end for now. I'll review it tomorrow and hopefully we can get a release out!

Copy link
Contributor

@J0 J0 left a comment

Choose a reason for hiding this comment

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

LGTM, Thanks so much for this!

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.

2 participants