-
Notifications
You must be signed in to change notification settings - Fork 796
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
selection_point
fails schema validation
#3581
Comments
# change column name "year" to "iteration"
# df.rename(columns={"year": "iteration"})
source = df.rename(columns={"year": "iteration"}) @jpn-- in your code block, Does this fix the validation error? |
@dangotbanned Apologies, I had a bad copy-and-paste job into the issue. I've corrected the code above, the error still persists; and actually, I've found the error occur even before my (now fixed) bug. I can reproduce the
|
Thanks for raising the issue! I can reproduce the error you are facing. The correct syntax that you should use in this situation is the following: select_year = alt.selection_point(
name="Year",
fields=["iteration"],
bind=alt.binding_range(min=1900, max=2000, step=10, name="Year"),
value=2000
) So instead of |
Ah, I see that you actually refer to this example in the documentation: https://altair-viz.github.io/gallery/us_population_over_time.html. That should be updated! |
Thanks @mattijn. Now knowing the correct syntax, I've opened a PR to fix the docs in the places where the outdated syntax was used. |
What happened?
I am trying to create an interactive figure that filters on data by iteration, but I am getting a SchemaValidationError:
SchemaValidationError: '2000' is an invalid value for
iteration. Valid values are of type 'array'.
If I copy the published example from here, and run it, it works fine. But if I simply change the name of the data column "year" to "iteration", I can reproduce the failure.
What would you like to happen instead?
The selection should work and not depend on the variable name literally being "year".
Which version of Altair are you using?
5.4.1
The text was updated successfully, but these errors were encountered: