pola-rs/polars · error

Altair has no method 'mark_{attr}'

Error message

Altair has no method 'mark_{attr}'

What it means

Error "Altair has no method 'mark_{attr}'" thrown in pola-rs/polars.

Source

Thrown at py-polars/src/polars/dataframe/plotting.py:241

        if size is not None:
            encodings["size"] = size
        return (
            self._chart.mark_point(tooltip=True)
            .encode(
                **encodings,
                **kwargs,
            )
            .interactive()
        )

    # Alias to `point` because of how common it is.
    scatter = point

    def __getattr__(self, attr: str) -> Callable[..., alt.Chart]:
        method = getattr(self._chart, f"mark_{attr}", None)
        if method is None:
            msg = f"Altair has no method 'mark_{attr}'"
            raise AttributeError(msg)

        accepts_tooltip_argument = "tooltip" in {
            value.name for value in inspect.signature(method).parameters.values()
        }
        if accepts_tooltip_argument:

            def func(**kwargs: EncodeKwds) -> alt.Chart:
                return method(tooltip=True).encode(**kwargs).interactive()
        else:

            def func(**kwargs: EncodeKwds) -> alt.Chart:
                return method().encode(**kwargs).interactive()

        return func

View on GitHub (pinned to df599052da)

When it happens

Trigger: Thrown at py-polars/src/polars/dataframe/plotting.py:241 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pola-rs/polars@df599052da (2026-08-16). Data as JSON: /api/errors/926d7f8e9b39e9a3. Report an issue: GitHub.