Skip to content

Commit 3d90780

Browse files
Merge pull request #37 from developmentseed/boolfix
Fix Boolean Support
2 parents 5fe92dd + 1c160f8 commit 3d90780

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tifeatures/filter/filters.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def quote_ident(s: str) -> str:
265265
raise TypeError(f"{s} is not a valid identifier")
266266

267267

268-
def attribute(name: str, fields: List[str]) -> V:
268+
def attribute(name: str, fields: List[str]):
269269
"""Create an attribute lookup expression using a field mapping dictionary.
270270
271271
:param name: the field filter name
@@ -274,6 +274,10 @@ def attribute(name: str, fields: List[str]) -> V:
274274
"""
275275
if name in fields:
276276
return V(name)
277+
elif name.lower() == "true":
278+
return True
279+
elif name.lower() == "false":
280+
return False
277281
else:
278282
raise TypeError(f"Field {name} not in table.")
279283

0 commit comments

Comments
 (0)