Skip to content
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

[dev] Fix issues when comparing text fields with None #21

Merged
merged 1 commit into from
Nov 26, 2019

Conversation

rlessardrodeofx
Copy link

Purpose of the PR

This PR fix an issue introduced by #20 when comparing text field with None values. It also fix a bug with the "not_contains" operator.

After this is approved I will update our upstream PR (shotgunsoftware#217).

Overview of the changes

  • Better conforming, aware of None values
  • Add unit-tests
  • Fix "not_contains" not behavior as a real Shotgun instance

Type of feedback wanted

Any kind of feedback.
Is there any cases I did not test? (Note that some operators have no test againts a None value as they crash with a normal shotgun instance, they are: "contains", "not_contains", "starts_with" and "ends_with")

Where should the reviewer start looking at?

Diff should be enough

Potential risks of this change

Some tests that where using mockgun could start failing (which in my case is what I want).

Relationship with other PRs

Continuation of the work in #20

@@ -613,7 +622,7 @@ def _compare(self, field_type, lval, operator, rval):
elif operator == "contains":
return rval in lval
elif operator == "not_contains":
return lval not in rval
return rval not in lval
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a behavior change, it seem the "not_contains" in mockgun just wasnt working right.

@charlesfleche
Copy link

Would you mind to add me as a reviewer ?

Copy link

@swaugh-rodeo swaugh-rodeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JeanChristopheMorinRodeoFX

@rlessardrodeofx We should push the Shotgun team to review the upstream PR.

@rlessardrodeofx rlessardrodeofx merged commit 7f2a98b into rdo_master Nov 26, 2019
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.

5 participants