Skip to content

typing: mypy infers from_native(IntoFrameT) -> IntoDataFrameT #3319

@afrisgaard

Description

@afrisgaard

What type of report is this?

Correction

Please describe the issue.

My linter is not happy when I use the combined typeVar IntoFrameT for both DataFrame and LazyFrame with from_native()

It seems it's only happy with me using the IntoDataFrameT or IntoLazyFrameT and not the IntoFrameT notation.

Maybe I'm using it wrong. But from the docs it seems like functions where I handle both Lazy and Eager cases, should be IntoFrameT.

Using narwhals 2.12.0.
Happy:

Image

Un-happy:

Image

If you have a suggestion on how it should be, add it below.

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions