What happens?
Another issue for type check.
According to the documentation, StarExpression accepts a list (not clearly stated though) as its parameter. However, the stub has the signature (line 1021 in _duckdb-stubs/__init__.pyi, the main branch)
def StarExpression(*, exclude: Expression | str | tuple[str]) -> Expression: ...
To Reproduce
In example.py:
import duckdb
import pandas as pd
df = pd.DataFrame({
"a": [1, 2, 3, 4],
"b": [True, None, False, True],
"c": [42, 21, 13, 14]
})
star = duckdb.StarExpression(exclude = ['b'])
duckdb.df(df).select(star).show()
Then, run any type checker:
❯ uv run ty check example.py
error[invalid-argument-type]: Argument to function `StarExpression` is incorrect
--> example.py:10:30
|
8 | })
9 |
10 | star = duckdb.StarExpression(exclude = ['b'])
| ^^^^^^^^^^^^^^^ Expected `Expression | str | tuple[str]`, found `list[Unknown | str]`
11 | duckdb.df(df).select(star).show()
|
info: Matching overload defined here
--> .venv/lib/python3.13/site-packages/_duckdb-stubs/__init__.pyi:1041:5
|
1039 | def SQLExpression(expression: str) -> Expression: ...
1040 | @pytyping.overload
1041 | def StarExpression(*, exclude: Expression | str | tuple[str]) -> Expression: ...
| ^^^^^^^^^^^^^^ -------------------------------------- Parameter declared here
1042 | @pytyping.overload
1043 | def StarExpression() -> Expression: ...
|
info: Non-matching overloads for function `StarExpression`:
info: () -> Expression
info: rule `invalid-argument-type` is enabled by default
Found 1 diagnostic
OS:
aarch64_darwin
DuckDB Package Version:
1.4.2
Python Version:
3.13.9
Full Name:
Mitsuhiro Nacamura
Affiliation:
Nacamura Data Analysis
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration to reproduce the issue?
What happens?
Another issue for type check.
According to the documentation,
StarExpressionaccepts a list (not clearly stated though) as its parameter. However, the stub has the signature (line 1021 in_duckdb-stubs/__init__.pyi, the main branch)To Reproduce
In
example.py:Then, run any type checker:
OS:
aarch64_darwin
DuckDB Package Version:
1.4.2
Python Version:
3.13.9
Full Name:
Mitsuhiro Nacamura
Affiliation:
Nacamura Data Analysis
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Yes
Did you include all code required to reproduce the issue?
Did you include all relevant configuration to reproduce the issue?