rbw/pysnow

not_contains should be "NOT LIKE", not "NOTLIKE"

Closed this issue · 2 comments

The documentation on the ServiceNow website is conflicting. It suggests that the NOT LIKE operator shouldn't have a space in between. However, the example clearly shows a space between.

Testing in our production orlando instance the correct operator contains a space.

vrsh commented

As per ServiceNOW documentation and feature provided in not_contains method of pysnow, the correct reference is NOT LIKE
@alex-way If the Docstring of the method was your concern I have modified it.

rbw commented

@alex-way You're right, the ServiceNow documentation is ambiguous about the does not contain operator; It suggests both NOT LIKE (which works and is used by pysnow), and NOTLIKE.

I think NOTLIKE would be more appropriate, as it'd be consistent with rest of the operator values. But ServiceNow decided to use NOT LIKE instead. This minor lack of consistency caused this Issue, and probably the documentation error - both in pysnow and the ServiceNow official docs.
That shows how important consistency is I guess :)

I checked the other library I'm working on, aiosnow, and there I used !* instead (maybe for this reason, can't remember).

https://aiosnow.readthedocs.io/en/latest/reference/fields/string.html#aiosnow.fields.string.StringQueryable.contains