-
Notifications
You must be signed in to change notification settings - Fork 198
Conversation
parts.append("%s eq %s" % (field_name, str(x).lower)) | ||
if isinstance(values[0], int): | ||
parts.append("%s eq %s" % (field_name, str(x).lower())) | ||
elif isinstance(values[0], int): |
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.
Confirming: this shouldn't actually matter, since bool
is not a subclass of int
. You are just updating this to be consistent with the larger control flow here, which is conceptually a big match
.
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.
Unfortunately, bool is a subclass of int. This was generating queries that were field == 0
, where we needed field eq false
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> a = False
>>> isinstance(a, int)
True
>>>
@@ -148,8 +148,8 @@ def build_filters( | |||
for x in values: | |||
if not isinstance(x, bool): | |||
raise TypeError("unexpected type") | |||
parts.append("%s eq %s" % (field_name, str(x).lower)) | |||
if isinstance(values[0], int): | |||
parts.append("%s eq %s" % (field_name, str(x).lower())) |
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.
This is where the actual bug was.
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.
This is a two-part bug.
Hello @bmc-msft! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
This addresses broken queries used for identifying outdated nodes.