-
Notifications
You must be signed in to change notification settings - Fork 4
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
Add Insensitive Like Operator to WHERE Filter #273
Conversation
Codecov Report
@@ Coverage Diff @@
## master #273 +/- ##
==========================================
+ Coverage 91.23% 91.25% +0.02%
==========================================
Files 32 32
Lines 2395 2401 +6
Branches 205 207 +2
==========================================
+ Hits 2185 2191 +6
Misses 186 186
Partials 24 24
Continue to review full report at Codecov.
|
Ignore the failing check from 'Semantic Pull Request'. This tool will be used for the versioning i.e. once #242 is closed. |
The safety part of the CI workflow will be fixed once #278 is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and manual tests pass as expected!
This PR will close #243
Description
This adds two new operators for the WHERE filter,
ilike
andnilike
. The first one will be used for ral-facilities/datagateway#731, and the not like alternative was simple to implement while I was there so I might as well ready for the Search API. This makes use of JPQL functions, specificallyUPPER()
will is applied to both sides of the query, the values in icatdb as well as the value given by the user. The support for JPQL functions is being added in 0.20.0 of Python ICAT.For ral-facilities/datagateway#731 to be fixed, there will need to be a search and replace task on
like
toilike
in DataGateway. Equally, I'm happy to quickly change this PR so thelike
is actually case insensitive, but I believe having a specificilike
operator is the last thing we agreed on verbally. Something for @louise-davies and I to discuss.I've had to edit some of the existing unit tests because there are some small changes in how conditions are stored in Python ICAT. The main change is that the conditions (stored in dictionary keys) are always stored as a list of strings, even if there is only a single condition per attribute. This makes no difference to functionality (nor am I concerned about this for anything in the future) but did require editing the tests to suit the new behaviour.
This PR will remain in a draft state until Python ICAT 0.20.0 has been released and I update the API's dependencies to use the new version.
I've also been trying to add a couple of tests that create a test DataGateway API (using Flask's test app) but pointing to ISIS dev ICAT instead of localhost. I've got it working independently of the rest of the tests, but it seems to get confused with the other test apps that run on localhost when running all tests together. I've got this saved in a stash and will try to get it working - don't want to spend excessive amounts of time on it.
Testing Instructions
ICATs using mariadb are case insensitive by nature so this feature must be tested on an ICAT which uses an Oracle database. I have been using ISIS production and dev for my own manual testing, with the following requests:
Until Python ICAT 0.20.0 is released, you'll need to build and install the fixes in Python ICAT manually.
icatdb Generator Script Consistency Test
CI job fails, is this because of a deliberate change made to the script to change generated data (which isn't actually a problem) or is there an underlying issue with the changes made?Agile Board Tracking
Connect to #243