We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
channels.py
While rewriting some alt.condition(s) to alt.when(s) in #3544 I came across some examples that work correctly - but upset a type checker.
alt.condition
alt.when
import altair as alt from vega_datasets import data source = data.cars() color = ( alt.when(alt.datum.Weight_in_lbs >= 3500) .then(alt.value("hotpink")) .otherwise(alt.value("goldenrod")) ) chart = ( alt.Chart(source, width=300, height=150) .mark_rect() .encode( x=alt.X("Cylinders:N").axis(labelColor=color), y=alt.Y("Origin:N", axis=alt.Axis(tickColor=color)), color=color, ) ) chart
The issue is unrelated to #3552, and can instead reuse the solution from #3458.
Not expecting this will require any runtime changes.
However, it will very likely create a huge diff since so much of the generated code will have changes like below:
Map: TypeAlias = Mapping[str, Any] before: dict | SchemaBase after: Map | SchemaBase
Creating an issue for visibility and to note that it will need to be merged before #3544 to avoid needing to ignore typing for examples
Not require # type: ignore comments for expected use of public API.
# type: ignore
5.4.0, 5.4.1, 5.5.0dev
5.4.0
5.4.1
5.5.0dev
The text was updated successfully, but these errors were encountered:
test(typing): Add failing tests
93ba657
#3572
dict
Then
Successfully merging a pull request may close this issue.
What happened?
While rewriting some
alt.condition
(s) toalt.when
(s) in #3544 I came across some examples that work correctly - but upset a type checker.Minimal Repro
Code block
Screenshot
Didn't promise it looks pretty, but the spec validatesSolution
The issue is unrelated to #3552, and can instead reuse the solution from #3458.
Not expecting this will require any runtime changes.
However, it will very likely create a huge diff since so much of the generated code will have changes like below:
Creating an issue for visibility and to note that it will need to be merged before #3544 to avoid needing to ignore typing for examples
What would you like to happen instead?
Not require
# type: ignore
comments for expected use of public API.Which version of Altair are you using?
5.4.0
,5.4.1
,5.5.0dev
The text was updated successfully, but these errors were encountered: