Skip to content

typing: fix 1.4.1 stubs #131

Closed
Closed

Description

@dangotbanned

Originally posted by @dangotbanned in #124

Downstream in narwhals, I've got a PR open which is trying to adjust to the new stubs:

From #96 the issues we have seem to stem from (236713a) and (f5d4e42) after which we get a lot of false negatives on:

  • ConstantExpression
  • LambdaExpression
  • DuckDBPyType

I think the fixes I have for ConstantExpression + LambdaExpression would be pretty minor.

There's 1 or 2 examples for ConstantExpression in the test suite already 😉

Show ConstantExpression

image

DuckDBPyType might be a little more involved, since it's an issue with children.
Also the way I've worked around it in narwhals probably wouldn't be the same thing I'd write in the stubs

Activity

  1. evertlammerts commented on Feb 17, 2026

    @evertlammerts
    Member

    Fixed in #323. The children property was typed as list[tuple[str, object]] which gave callers no useful type information. Changed it to list[tuple[str, DuckDBPyType | int | list[str]]] to reflect what the C++ implementation actually returns (DuckDBPyType for nested types, int for DECIMAL precision/scale and ARRAY size, and list[str] for ENUM values).

    Note: the ConstantExpression and LambdaExpression issues from the original report were already resolved in a previous release when their parameter types were changed to Any.

  2. added a commit that references this issue on Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions