Skip to content

Partially unknown type for some functions (mark_line, save...) #3870

@alec-bike

Description

@alec-bike

What happened?

I'm getting type checking (basedpyright) reportUnknownMemberType warnings for some Altair functions, such as mark_* and save. Others, like Chart and encode, are fine. Does not affect functionality, just trips up the type-checker.

Example:

from altair import Chart

Chart(df.unpivot(on=matches(regex), index=idx, value_name=ylab))
        .mark_line()
        .encode(x=idx, y=ylab, color="variable")

basedpyright output:

Type of "mark_line" is partially unknown
  Type of "mark_line" is "(align: Parameter | SchemaBase
          ...
          **kwds: Unknown) -> Chart" (basedpyright reportUnknownMemberType)

What would you like to happen instead?

No warnings.

Which version of Altair are you using?

5.5.0

Edit: add example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triageBug report needs maintainer response

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions