Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

tests: update tests and typings to support altair v6 (#7162)

Myles Scolnick87c24628134d
diff --git a/marimo/_plugins/ui/_impl/altair_chart.py b/marimo/_plugins/ui/_impl/altair_chart.py
index 1fe7cb807b..b57d5c38bf 100644
--- a/marimo/_plugins/ui/_impl/altair_chart.py
+++ b/marimo/_plugins/ui/_impl/altair_chart.py
@@ -57,7 +57,7 @@ ChartDataType = Union[
]
# Union of all possible chart types
-AltairChartType: TypeAlias = "altair.vegalite.v5.api.ChartType"
+AltairChartType: TypeAlias = "altair.vegalite.v6.api.ChartType"
def _has_binning(spec: VegaSpec) -> bool:
diff --git a/tests/_data/snapshots/charts_json.txt b/tests/_data/snapshots/charts_json.txt
index 6c791ea01b..b7a84ddd2f 100644
--- a/tests/_data/snapshots/charts_json.txt
+++ b/tests/_data/snapshots/charts_json.txt
@@ -1,6 +1,6 @@
# boolean
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
@@ -160,7 +160,7 @@
# date
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
@@ -251,7 +251,7 @@
"opacity": {
"condition": {
"empty": false,
- "param": "param_1",
+ "param": "param_96a7a058ae444b29",
"value": 1
},
"value": 0
@@ -298,7 +298,7 @@
"opacity": {
"condition": {
"empty": false,
- "param": "param_1",
+ "param": "param_96a7a058ae444b29",
"value": 0.6
},
"value": 0
@@ -327,7 +327,7 @@
"strokeWidth": 1,
"type": "rule"
},
- "name": "view_1",
+ "name": "view_08552f810e029e90_2",
"transform": [
{
"filter": "datum.some_column != null"
@@ -353,7 +353,7 @@
],
"params": [
{
- "name": "param_1",
+ "name": "param_96a7a058ae444b29",
"select": {
"fields": [
"date_some_column"
@@ -363,7 +363,7 @@
"type": "point"
},
"views": [
- "view_1"
+ "view_08552f810e029e90_2"
]
}
],
@@ -372,7 +372,7 @@
# datetime
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
@@ -463,7 +463,7 @@
"opacity": {
"condition": {
"empty": false,
- "param": "param_2",
+ "param": "param_96a7a058ae444b29",
"value": 1
},
"value": 0
@@ -510,7 +510,7 @@
"opacity": {
"condition": {
"empty": false,
- "param": "param_2",
+ "param": "param_96a7a058ae444b29",
"value": 0.6
},
"value": 0
@@ -539,7 +539,7 @@
"strokeWidth": 1,
"type": "rule"
},
- "name": "view_2",
+ "name": "view_08552f810e029e90_2",
"transform": [
{
"filter": "datum.some_column != null"
@@ -565,7 +565,7 @@
],
"params": [
{
- "name": "param_2",
+ "name": "param_96a7a058ae444b29",
"select": {
"fields": [
"date_some_column"
@@ -575,7 +575,7 @@
"type": "point"
},
"views": [
- "view_2"
+ "view_08552f810e029e90_2"
]
}
],
@@ -584,7 +584,7 @@
# time
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
@@ -675,7 +675,7 @@
"opacity": {
"condition": {
"empty": false,
- "param": "param_3",
+ "param": "param_96a7a058ae444b29",
"value": 1
},
"value": 0
@@ -722,7 +722,7 @@
"opacity": {
"condition": {
"empty": false,
- "param": "param_3",
+ "param": "param_96a7a058ae444b29",
"value": 0.6
},
"value": 0
@@ -751,7 +751,7 @@
"strokeWidth": 1,
"type": "rule"
},
- "name": "view_3",
+ "name": "view_08552f810e029e90_2",
"transform": [
{
"filter": "datum.some_column != null"
@@ -777,7 +777,7 @@
],
"params": [
{
- "name": "param_3",
+ "name": "param_96a7a058ae444b29",
"select": {
"fields": [
"date_some_column"
@@ -787,7 +787,7 @@
"type": "point"
},
"views": [
- "view_3"
+ "view_08552f810e029e90_2"
]
}
],
@@ -796,7 +796,7 @@
# integer
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
@@ -857,7 +857,7 @@
# number
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
@@ -919,7 +919,7 @@
# string
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
@@ -1117,7 +1117,7 @@
# string (limit to 10 items)
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
@@ -1321,7 +1321,7 @@
# unknown
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
diff --git a/tests/_data/snapshots/charts_json_bad_data.txt b/tests/_data/snapshots/charts_json_bad_data.txt
index 193391bbda..3bcc34bb68 100644
--- a/tests/_data/snapshots/charts_json_bad_data.txt
+++ b/tests/_data/snapshots/charts_json_bad_data.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
diff --git a/tests/_data/snapshots/column_preview_bool_chart_spec.txt b/tests/_data/snapshots/column_preview_bool_chart_spec.txt
index ab62f4b6b5..0b3ca357dc 100644
--- a/tests/_data/snapshots/column_preview_bool_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_bool_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
diff --git a/tests/_data/snapshots/column_preview_bool_chart_spec_with_vegafusion.txt b/tests/_data/snapshots/column_preview_bool_chart_spec_with_vegafusion.txt
index 838505f0db..368ba4e2e6 100644
--- a/tests/_data/snapshots/column_preview_bool_chart_spec_with_vegafusion.txt
+++ b/tests/_data/snapshots/column_preview_bool_chart_spec_with_vegafusion.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_data/snapshots/column_preview_categorical_chart_spec.txt b/tests/_data/snapshots/column_preview_categorical_chart_spec.txt
index 66ffb29a25..51e5a4d2e3 100644
--- a/tests/_data/snapshots/column_preview_categorical_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_categorical_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
diff --git a/tests/_data/snapshots/column_preview_categorical_chart_spec_with_vegafusion.txt b/tests/_data/snapshots/column_preview_categorical_chart_spec_with_vegafusion.txt
index c0f54f7b8b..80c9319efe 100644
--- a/tests/_data/snapshots/column_preview_categorical_chart_spec_with_vegafusion.txt
+++ b/tests/_data/snapshots/column_preview_categorical_chart_spec_with_vegafusion.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_data/snapshots/column_preview_duckdb_bool_chart_spec.txt b/tests/_data/snapshots/column_preview_duckdb_bool_chart_spec.txt
index d535968f01..2c4f63dccf 100644
--- a/tests/_data/snapshots/column_preview_duckdb_bool_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_duckdb_bool_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_data/snapshots/column_preview_duckdb_categorical_chart_spec.txt b/tests/_data/snapshots/column_preview_duckdb_categorical_chart_spec.txt
index edb52426a0..c83516046b 100644
--- a/tests/_data/snapshots/column_preview_duckdb_categorical_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_duckdb_categorical_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_data/snapshots/column_preview_float_chart_spec.txt b/tests/_data/snapshots/column_preview_float_chart_spec.txt
index 81ee7a1f5f..1ed75ac0c5 100644
--- a/tests/_data/snapshots/column_preview_float_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_float_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
diff --git a/tests/_data/snapshots/column_preview_float_chart_spec_with_vegafusion.txt b/tests/_data/snapshots/column_preview_float_chart_spec_with_vegafusion.txt
index cb6dd4e51d..59744e97c3 100644
--- a/tests/_data/snapshots/column_preview_float_chart_spec_with_vegafusion.txt
+++ b/tests/_data/snapshots/column_preview_float_chart_spec_with_vegafusion.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_data/snapshots/column_preview_int_chart_spec.txt b/tests/_data/snapshots/column_preview_int_chart_spec.txt
index 5deadde098..2897b87e1b 100644
--- a/tests/_data/snapshots/column_preview_int_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_int_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"view": {
"continuousHeight": 300,
diff --git a/tests/_data/snapshots/column_preview_int_chart_spec_with_vegafusion.txt b/tests/_data/snapshots/column_preview_int_chart_spec_with_vegafusion.txt
index 5ba8089286..0f5ab44d96 100644
--- a/tests/_data/snapshots/column_preview_int_chart_spec_with_vegafusion.txt
+++ b/tests/_data/snapshots/column_preview_int_chart_spec_with_vegafusion.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_data/snapshots/column_preview_str_chart_spec.txt b/tests/_data/snapshots/column_preview_str_chart_spec.txt
index 30521f985b..634a65590b 100644
--- a/tests/_data/snapshots/column_preview_str_chart_spec.txt
+++ b/tests/_data/snapshots/column_preview_str_chart_spec.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json",
"config": {
"axis": {
"grid": false
diff --git a/tests/_data/snapshots/column_preview_str_chart_spec_with_vegafusion.txt b/tests/_data/snapshots/column_preview_str_chart_spec_with_vegafusion.txt
index 412385148c..14f96e08bb 100644
--- a/tests/_data/snapshots/column_preview_str_chart_spec_with_vegafusion.txt
+++ b/tests/_data/snapshots/column_preview_str_chart_spec_with_vegafusion.txt
@@ -1,5 +1,5 @@
{
- "$schema": "https://vega.github.io/schema/vega/v5.json",
+ "$schema": "https://vega.github.io/schema/vega/v6.json",
"autosize": {
"contains": "padding",
"type": "fit-x"
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_duckdb.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_duckdb.txt
index 5cc1f539e5..431e29d7a2 100644
--- a/tests/_plugins/ui/_impl/snapshots/parse_spec_duckdb.txt
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_duckdb.txt
@@ -20,5 +20,5 @@
"type": "quantitative"
}
},
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json"
}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt
index 257f6fbbea..cff423633f 100644
--- a/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_narwhal.txt
@@ -20,5 +20,5 @@
"type": "quantitative"
}
},
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json"
}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt
index 257f6fbbea..cff423633f 100644
--- a/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_pandas.txt
@@ -20,5 +20,5 @@
"type": "quantitative"
}
},
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json"
}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_polars.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_polars.txt
index 257f6fbbea..cff423633f 100644
--- a/tests/_plugins/ui/_impl/snapshots/parse_spec_polars.txt
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_polars.txt
@@ -20,5 +20,5 @@
"type": "quantitative"
}
},
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json"
}
\ No newline at end of file
diff --git a/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt b/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt
index d1b3e51027..8b85681afe 100644
--- a/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt
+++ b/tests/_plugins/ui/_impl/snapshots/parse_spec_url.txt
@@ -17,5 +17,5 @@
"type": "quantitative"
}
},
- "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json"
+ "$schema": "https://vega.github.io/schema/vega-lite/v6.1.0.json"
}
\ No newline at end of file