From 2d57d6ec74f868eb08811602475d7beb2a57fd8a Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:17:14 +0000 Subject: [PATCH] docs(typing): Update `_FieldEqualType` Think this makes it clearer how each of these align --- altair/vegalite/v5/api.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/altair/vegalite/v5/api.py b/altair/vegalite/v5/api.py index 6eb6b7d63..115fe7e3c 100644 --- a/altair/vegalite/v5/api.py +++ b/altair/vegalite/v5/api.py @@ -543,11 +543,18 @@ def check_fields_and_encodings(parameter: Parameter, field_name: str) -> bool: _FieldEqualType: TypeAlias = Union["IntoExpression", Parameter, SchemaBase] -"""Permitted types for equality checks on field values: +""" +Permitted types for equality checks on field values. + +Applies to the following context(s): + + import altair as alt -- `datum.field == ...` -- `FieldEqualPredicate(equal=...)` -- `when(**constraints=...)` + alt.datum.field == ... + alt.FieldEqualPredicate(field="field", equal=...) + alt.when(field=...) + alt.when().then().when(field=...) + alt.Chart.transform_filter(field=...) """