Closed
Description
openedon May 25, 2020
Consider:
selection = alt.selection_single()
(alt.Chart(data=None)
.mark_circle()
.encode(color=alt.value('red'), invalidChannel=None))
Predictably, this fails with:
SchemaValidationError: Invalid specification
altair.vegalite.v4.schema.core.FacetedEncoding, validating 'additionalProperties'
Additional properties are not allowed ('invalidChannel' was unexpected)
So far so good. But now watch what happens if x
is set to a selection:
selection = alt.selection_single()
(alt.Chart(data=None)
.mark_circle()
.add_selection(selection)
.encode(
color=alt.condition(selection, alt.value('red'), alt.value('green')),
invalidChannel=None))
This time, the error message is way more confusing and doesn't point to the actual cause of the problem:
SchemaValidationError: Invalid specification
altair.vegalite.v4.schema.channels.ColorValue, validating 'additionalProperties'
Additional properties are not allowed ('selection' was unexpected)
The misleading error message made me waste a lot of time chasing down dead ends simply because I mistyped tooltip
as tooltips
:(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment