Skip to content

Commit 32f8c94

Browse files
committed
fix ability to use booleans
1 parent 257246a commit 32f8c94

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() in ("true", "t", "1"):
278+
return True
279+
elif name.lower() in ("false", "f", "0"):
280+
return False
277281
else:
278282
print(name, fields)
279283
raise TypeError(f"Field {name} not in table.")

0 commit comments

Comments
 (0)