Skip to content

feat: add .contains and .contained_by operators to match JS client #100

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 4 commits into from
Mar 13, 2022

Conversation

parrotmac
Copy link
Contributor

@parrotmac parrotmac commented Mar 12, 2022

This change fixes #99.

Specifically, this change enables a PostgREST cs.*** query that searches an Array, such as [{"foo": "bar"}]. This aim to to keep the same API as .cs/.cd, modeled after the JS library's implementations.

@parrotmac parrotmac marked this pull request as ready for review March 12, 2022 22:52
@codecov
Copy link

codecov bot commented Mar 12, 2022

Codecov Report

Merging #100 (4337de7) into master (796687d) will increase coverage by 0.26%.
The diff coverage is 95.55%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
+ Coverage   90.10%   90.37%   +0.26%     
==========================================
  Files          22       22              
  Lines         869      914      +45     
==========================================
+ Hits          783      826      +43     
- Misses         86       88       +2     
Impacted Files Coverage Δ
postgrest_py/base_request_builder.py 76.92% <86.66%> (+0.87%) ⬆️
tests/_async/test_filter_request_builder.py 100.00% <100.00%> (ø)
tests/_sync/test_filter_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 796687d...4337de7. Read the comment docs.

@leynier
Copy link
Contributor

leynier commented Mar 12, 2022

Hi @parrotmac, can you implement tests for the new filters? If you are busy I will do it soon and then we merge the pull request. Are you okay with that?

@parrotmac
Copy link
Contributor Author

Hi @parrotmac, can you implement tests for the new filters? If you are busy I will do it soon and then we merge the pull request. Are you okay with that?

Hey! I'll see about adding tests but if you beat me to it feel free to add commits/merge whenever 🙂

@J0
Copy link
Contributor

J0 commented Mar 13, 2022

Thanks for the PR! It looks good to me -- think we just need tests

@parrotmac
Copy link
Contributor Author

Hey! Just added a few tests. Let me know if we want anything changed!

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Mar 13, 2022

Sourcery Code Quality Report

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

Quality metrics Before After Change
Complexity 0.67 ⭐ 0.72 ⭐ 0.05 👎
Method Length 23.77 ⭐ 24.31 ⭐ 0.54 👎
Working memory 5.12 ⭐ 4.96 ⭐ -0.16 👍
Quality 90.65% 90.92% 0.27% 👍
Other metrics Before After Change
Lines 268 336 68
Changed files Quality Before Quality After Quality Change
postgrest_py/base_request_builder.py 88.74% ⭐ 87.87% ⭐ -0.87% 👎
tests/_async/test_filter_request_builder.py 97.41% ⭐ 97.78% ⭐ 0.37% 👍
tests/_sync/test_filter_request_builder.py 97.41% ⭐ 97.78% ⭐ 0.37% 👍

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!

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

@leynier
Copy link
Contributor

leynier commented Mar 13, 2022

LGTM @parrotmac thanks for the contribution

@leynier leynier changed the title Add .contains and .contained_by operators to match JS client feat: add .contains and .contained_by operators to match JS client Mar 13, 2022
@leynier leynier merged commit 7189e09 into supabase:master Mar 13, 2022
@parrotmac parrotmac deleted the isaac/add-contains-contained-by branch March 13, 2022 23:11
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.

No matching implementation for .contains
3 participants