Skip to content

fix: update snapshots and types for altair v6.1.0 / vega-lite v6.4.1#9415

Merged
mscolnick merged 5 commits into
mainfrom
ms/fix/altair-upgrade-breaks
Apr 28, 2026
Merged

fix: update snapshots and types for altair v6.1.0 / vega-lite v6.4.1#9415
mscolnick merged 5 commits into
mainfrom
ms/fix/altair-upgrade-breaks

Conversation

@mscolnick

Copy link
Copy Markdown
Contributor

CI was failing on main after the altair upgrade landed:

  • snapshots referenced vega-lite v6.1.0 schema and old view-hash names
  • alt.layer now returns LayerChart | FacetChart, breaking add_common_config
  • vlc.get_*_locale signatures became Literal-typed

CI was failing on main after the altair upgrade landed:
- snapshots referenced vega-lite v6.1.0 schema and old view-hash names
- alt.layer now returns LayerChart | FacetChart, breaking add_common_config
- vlc.get_*_locale signatures became Literal-typed
@vercel

vercel Bot commented Apr 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 28, 2026 3:18pm

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 23 files

Architecture diagram
sequenceDiagram
    participant User as "User/Notebook"
    participant Charts as "marimo._data.charts"
    participant Altair as "Altair v6.1.0+"
    participant Format as "marimo._output.formatters"
    participant VLC as "vl-convert (External)"
    participant Snap as "Test Snapshots"

    Note over User,Altair: Chart Creation & Configuration
    User->>Altair: Define Chart (Layered or Faceted)
    User->>Charts: add_common_config(chart)
    
    rect rgb(240, 240, 240)
        Note right of Charts: CHANGED: Supports alt.FacetChart<br/>returned by v6.1.0 layers
        Charts->>Altair: chart.properties(width='container')
        Charts->>Altair: chart.configure_view(stroke=None)
    end
    Altair-->>User: Configured Chart Object

    Note over User,VLC: Serialization & Locale Handling
    User->>Format: render(chart)
    Format->>VLC: CHANGED: get_format_locale(locale)
    Note right of VLC: Literal-typed signatures<br/>enforced via type ignore
    VLC-->>Format: Locale Dict
    
    Format->>Format: Generate Vega-Lite JSON
    Note right of Format: NEW: Schema v6.4.1<br/>NEW: Updated view-hash naming<br/>NEW: join() tooltips for arrays

    Note over Format,Snap: Regression Testing
    Format->>Snap: Compare generated JSON
    alt Success
        Snap-->>Format: Match
    else CHANGED: Schema/Hash Mismatch
        Snap-->>Format: Fail (requires update)
    end
Loading

@mscolnick mscolnick added the enhancement New feature or request label Apr 28, 2026
vega-lite 6.4.2 (2026-01-14) ships vega-lite#9707, which fixes the
"undefined" numeric tooltip with selection_point(nearest=True). Drop
the CI guard and renovate exclusion that pinned us to 6.3.1 for that
reason.
@mscolnick

Copy link
Copy Markdown
Contributor Author

Verified the numeric tooltip bug is no longer there.

Details

import marimo

__generated_with = "0.23.3"
app = marimo.App()


@app.cell
def _():
    import marimo as mo

    mo.md(
        """
        # Verify vega-lite tooltip fix

        This notebook reproduces the numeric-tooltip bug fixed by
        [vega-lite#9707](https://github.com/vega/vega-lite/pull/9707) (released in
        vega-lite **6.4.2**).

        The bug: when hovering near a point on a chart that uses
        `selection_point(nearest=True)`, the tooltip would show `undefined`
        instead of the actual numeric value.

        **Hover over the points below.** The tooltip should display real
        numbers — not `undefined`.
        """
    )
    return (mo,)


@app.cell
def _():
    import altair as alt
    import pandas as pd

    return alt, pd


@app.cell
def _(alt, pd):
    df = pd.DataFrame(
        {
            "x": list(range(20)),
            "y": [v * v for v in range(20)],
        }
    )

    nearest = alt.selection_point(
        fields=["x"], nearest=True, on="mouseover", empty=False
    )

    line = alt.Chart(df).mark_line().encode(x="x:Q", y="y:Q")
    points = (
        alt.Chart(df)
        .mark_point(size=80, filled=True)
        .encode(
            x="x:Q",
            y="y:Q",
            opacity=alt.condition(nearest, alt.value(1), alt.value(0)),
            tooltip=["x:Q", "y:Q"],
        )
        .add_params(nearest)
    )

    chart = (line + points).properties(
        title="Hover near points — tooltip should show numbers, not `undefined`"
    )
    chart
    return


@app.cell
def _(mo):
    mo.md("""
    ## Datasource panel chart

    The same pattern is used by the datasource preview chart for date
    columns (see `DateChartBuilder` in `marimo/_data/charts.py`). If the
    upgrade is good, hovering anywhere along the area below should show
    the count and date — never `undefined`.
    """)
    return


@app.cell
def _(alt, pd):
    import datetime as _dt

    dates = pd.DataFrame(
        {
            "date": [
                _dt.date(2024, 1, 1) + _dt.timedelta(days=i)
                for i in range(60)
            ],
            "count": [i % 7 + 1 for i in range(60)],
        }
    )

    nearest_d = alt.selection_point(
        fields=["date"], nearest=True, on="mouseover", empty=False
    )

    base = alt.Chart(dates)
    area = base.mark_area(opacity=0.4).encode(x="date:T", y="count:Q")
    pts = (
        base.mark_point(size=80, filled=True)
        .encode(
            x="date:T",
            y="count:Q",
            opacity=alt.condition(nearest_d, alt.value(1), alt.value(0)),
            tooltip=[
                alt.Tooltip("date:T"),
                alt.Tooltip("count:Q", format=",.0f"),
            ],
        )
        .add_params(nearest_d)
    )
    (area + pts).properties(width="container", height=200)
    return


if __name__ == "__main__":
    app.run()

@mscolnick
mscolnick requested a review from dmadisetti April 28, 2026 15:15
@mscolnick
mscolnick merged commit 96b7ceb into main Apr 28, 2026
41 of 44 checks passed
@mscolnick
mscolnick deleted the ms/fix/altair-upgrade-breaks branch April 28, 2026 15:42
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.4-dev19

@codecov

codecov Bot commented Apr 28, 2026

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 24.13kB (-0.1%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
marimo-esm 25.12MB -24.13kB (-0.1%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: marimo-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/react-*.js -24.13kB 725.17kB -3.22%
assets/dist-*.js -79 bytes 177 bytes -30.86%
assets/dist-*.js -72 bytes 104 bytes -40.91%
assets/dist-*.js -5 bytes 164 bytes -2.96%
assets/dist-*.js -56 bytes 104 bytes -35.0%
assets/dist-*.js 204 bytes 387 bytes 111.48% ⚠️
assets/dist-*.js 74 bytes 176 bytes 72.55% ⚠️
assets/dist-*.js 32 bytes 169 bytes 23.36% ⚠️
assets/dist-*.js 92 bytes 256 bytes 56.1% ⚠️
assets/dist-*.js -139 bytes 137 bytes -50.36%
assets/dist-*.js 231 bytes 335 bytes 222.12% ⚠️
assets/dist-*.js -32 bytes 137 bytes -18.93%
assets/dist-*.js -99 bytes 160 bytes -38.22%
assets/dist-*.js 299 bytes 403 bytes 287.5% ⚠️
assets/dist-*.js -218 bytes 169 bytes -56.33%
assets/dist-*.js 139 bytes 276 bytes 101.46% ⚠️
assets/dist-*.js -144 bytes 259 bytes -35.73%
assets/dist-*.js -75 bytes 102 bytes -42.37%
assets/dist-*.js -152 bytes 183 bytes -45.37%
assets/__vite-*.js 5 bytes 98 bytes 5.38% ⚠️
assets/__vite-*.js -5 bytes 93 bytes -5.1%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant