-
Notifications
You must be signed in to change notification settings - Fork 94
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
Bugfix when chaining expressions using OR #283
base: master
Are you sure you want to change the base?
Conversation
b0a6235
to
7379b25
Compare
Hi, couple of notes I couldn't get pylint to work, i get error:
Must be some version mismatch but I couldn't (yet) track it down. I added a test and fixed a few existing ones but i think these tests aren't the best. These basically just verify the constructed URL is correct and not actually test the remote service. There could be a better way for this using pytest-vcr which does exactly that. Test remote services and their responses. But this would require a bit more effort to implement, if you all want to go this route. Anyway, i probably forgot other things, let me know what you guys think. We've been using "our" version for a little while now ( few weels ) and i've had no complaints so I think it works ok. |
Thanks for all your work. Greatly appreciated.
from the issue comment:
both should most probably return different set of data in the response. You responded in the middle with the but we'll know more after running the tests :) But there is just one quite simple test added. I am not sure if you are covering all possible groupings or pre-selected one grouping only for the ORM style - and any other complex filter query would have to be written directly in the standard pyodata way. This is potentially breaking change, so if you are using the fixed version from your fork for several weeks, may I ask to add few more tests for these more complex chained expression that would use the experience you gained? This is moving in the right direction overall and I would love to merge it and release it - I have planned it for the next bugfix release. So this is not comment discarding the PR, on the contrary - request for improving a bit more.
|
so this
/Employees/$count?$filter=%28ID%20eq%2023%20and%20NickName%20eq%20%27Steve%27%29%20or%20%28ID%20eq%2025%20and%20NickName%20eq%20%27Tim%27%29
(ID eq 23 and NickName eq 'Steve') or (ID eq 25 and NickName eq 'Tim')
becomes
/Employees/$count?$filter=%28%28ID%20eq%2023%29%20and%20%28NickName%20eq%20%27Steve%27%29%29%20or%20%28%28ID%20eq%2025%29%20and%20%28NickName%20eq%20%27Tim%27%29%29
((ID eq 23) and (NickName eq 'Steve')) or ((ID eq 25) and (NickName eq 'Tim'))
Example 2:
consider this example, it demonstrates a bit better
startswith(NameFirst, 'Steve') eq true and ID eq 23 or ID eq 25 or ID eq 28
becomes(startswith(NameFirst, 'Steve') eq true) and (ID eq 23 or ID eq 25 or ID eq 28)