prisma-client-py icon indicating copy to clipboard operation
prisma-client-py copied to clipboard

feat(client): support ANY queries

Open leejayhsu opened this issue 2 years ago • 3 comments

Change Summary

In case the outcome of https://github.com/RobertCraigie/prisma-client-py/issues/293 is to officially support ANY queries, this PR attempts attempts to add support for it.

Unfortunately I was unable to support both OR and ANY, due to mypy issues. I was unable to resolve them, so have opted to just replace OR with ANY. This is certainly not ideal, but this is where it stands for now.

The mypy error encountered was:

ERROR: InvocationError for command /tmp/tox/prisma-client-py/mypy/bin/coverage run -m mypy --show-traceback --namespace-packages 

Checklist

  • [x] Unit tests for the changes exist
  • [x] Tests pass without significant drop in coverage
  • [x] Documentation reflects changes where applicable
  • [x] Test snapshots have been updated if applicable

Agreement

By submitting this pull request, I confirm that you can use, modify, copy and redistribute this contribution, under the terms of your choice.

leejayhsu avatar May 05 '22 04:05 leejayhsu

Codecov Report

Merging #389 (74456bd) into main (56a365c) will increase coverage by 0.00%. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #389   +/-   ##
=======================================
  Coverage   94.14%   94.15%           
=======================================
  Files         114      114           
  Lines        5789     5797    +8     
  Branches      325      325           
=======================================
+ Hits         5450     5458    +8     
  Misses        300      300           
  Partials       39       39           
Impacted Files Coverage Δ
src/prisma/_constants.py 100.00% <ø> (ø)
tests/test_find_first.py 100.00% <ø> (ø)
tests/test_find_many.py 100.00% <ø> (ø)
tests/test_group_by.py 100.00% <ø> (ø)
tests/test_include.py 100.00% <ø> (ø)
tests/test_delete_many.py 100.00% <100.00%> (ø)
src/prisma/generator/utils.py 96.61% <0.00%> (+0.11%) :arrow_up:

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 56a365c...74456bd. Read the comment docs.

codecov[bot] avatar May 05 '22 04:05 codecov[bot]

Looks like the errors that you're encountering are just a straight up mypy limitation, you could try removing the OR field and that might fix it.

RobertCraigie avatar May 05 '22 13:05 RobertCraigie

Hi, I'm also in favor of ANY FWIW :)

lewoudar avatar Jul 29 '22 08:07 lewoudar