Skip to content

Commit 09c355d

Browse files
committed
refactor: add empty as an explicit condition kwarg
This was already being handled internally, but now aligns with `when` and provides a documentable parameter. Related: vega#3485 (comment)
1 parent 72bd84d commit 09c355d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

altair/vegalite/v5/api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,6 +1492,8 @@ def condition(
14921492
predicate: _PredicateType,
14931493
if_true: _StatementType,
14941494
if_false: _StatementType,
1495+
*,
1496+
empty: Optional[bool] = Undefined,
14951497
**kwargs,
14961498
) -> SchemaBase | dict[str, _ConditionType | Any]:
14971499
"""A conditional attribute or encoding
@@ -1513,7 +1515,6 @@ def condition(
15131515
spec: dict or VegaLiteSchema
15141516
the spec that describes the condition
15151517
"""
1516-
empty = kwargs.pop("empty", Undefined)
15171518
condition = _predicate_to_condition(predicate, empty=empty)
15181519
return _condition_to_selection(condition, if_true, if_false, **kwargs)
15191520

0 commit comments

Comments
 (0)