Skip to content

Commit 71e73c0

Browse files
committed
fix(altair): use round instead of int and update related test
1 parent 04d078b commit 71e73c0

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

marimo/_output/formatters/altair_formatters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def _format_png_mimebundle(
120120
"image/png": data_url or "",
121121
METADATA_KEY: {
122122
"image/png": {
123-
"width": int(metadata["width"]),
124-
"height": int(metadata["height"]),
123+
"width": round(metadata["width"]),
124+
"height": round(metadata["height"]),
125125
}
126126
},
127127
}

tests/_output/formatters/test_altair_formatters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def test_altair_formatter_png():
190190
"_repr_mimebundle_",
191191
return_value=(
192192
{"image/png": b"png"},
193-
{"image/png": {"width": 10, "height": 20}},
193+
{"image/png": {"width": 10.2, "height": 19.8}},
194194
),
195195
):
196196
formatter = get_formatter(mock_chart)

0 commit comments

Comments
 (0)