Skip to content

Conversation

@Narwhal-fish
Copy link
Contributor

Fixes #209

The type stub for DuckDBPyRelation.aggregate incorrectly restricts the
aggr_expr parameter to Expression | str. However, the DuckDB Python API
and runtime behavior also support passing a list of Expression objects for
multiple aggregations.

The fix extends the type annotation to include list[Expression], aligning
the stub definition with the actual supported API behavior.

   def aggregate(
        self, aggr_expr: Expression | str | list[Expression], group_expr: Expression | str = ""
    ) -> DuckDBPyRelation: ...

@evertlammerts evertlammerts changed the base branch from main to v1.4-andium January 5, 2026 12:01
@evertlammerts evertlammerts changed the base branch from v1.4-andium to main January 5, 2026 12:01
@evertlammerts
Copy link
Collaborator

Thanks, LGTM! Can you rebase on v1.4-andium?

@Narwhal-fish
Copy link
Contributor Author

Thanks, LGTM! Can you rebase on v1.4-andium?

Sure!

@Narwhal-fish Narwhal-fish force-pushed the fix-DuckDBPyRelation.aggregate-incorrect-typing branch from 90f4b3c to f2bc4fa Compare January 6, 2026 05:31
@evertlammerts evertlammerts force-pushed the fix-DuckDBPyRelation.aggregate-incorrect-typing branch from f2bc4fa to b845b35 Compare January 6, 2026 09:35
@evertlammerts evertlammerts merged commit 45fb522 into duckdb:main Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DuckDBPyRelation.aggregate has incorrect typing

2 participants