Skip to content

_EncodingMixin.encode types defined too narrow #3552

@dangotbanned

Description

@dangotbanned

What happened?

Noticed this regression since #3515 while writing the test for #3394 (comment)

image

Minimal repro

import altair as alt

alt.Chart().encode(color=alt.when(x=1).then(alt.value("grey")))

What would you like to happen instead?

The types @binste and I defined for EncodeKwds were too strict and didn't account for alt.(condition|when).

The simplest fix would be to add SchemaBase to each annotation - as that is what Then falls into

Which version of Altair are you using?

c984002

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions