Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad types in Python relational API #9501

Closed
1 task done
davetapley opened this issue Oct 27, 2023 · 2 comments · Fixed by #9595
Closed
1 task done

Bad types in Python relational API #9501

davetapley opened this issue Oct 27, 2023 · 2 comments · Fixed by #9595

Comments

@davetapley
Copy link

What happens?

count('*') (and I'm sure others) from:

fail to type check with:

Arguments missing for parameters "groups", "window_spec", "projected_columns"

Pylance[reportGeneralTypeIssues]

(https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportGeneralTypeIssues)

To Reproduce

import duckdb
con = duckdb.connect()
con.sql('select 1').count('*')

You can also manually verify no defaults in method signature:

def count(self, column: str, groups: str, window_spec: str, projected_columns: str) -> DuckDBPyRelation: ...

OS:

Windows

DuckDB Version:

0.9.0

DuckDB Client:

Python

Full Name:

Dave Tapley

Affiliation:

JE Fuller

Have you tried this on the latest main branch?

I have tested with a main build

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have
@davetapley
Copy link
Author

Can use .aggregate('count(*)') as a workaround.

@Tishj
Copy link
Contributor

Tishj commented Nov 7, 2023

Thanks, this change was made by an outside contributor, dealing with this is tricky because it needs to be changed in 4 places, so things like this slip through the cracks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants