`select()` ignores `distinct`
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 45/100
Línea de trabajo
Comienza ejecutando el reproductor de Python del issue con la DuckDB table API e inspecciona cómo select("DISTINCT a, b") y distinct() construyen sus consultas SQL. El issue se considera completado cuando la consulta incluye SELECT DISTINCT a, b FROM main.foo, o cuando la API genera una excepción clara si esa forma no es compatible.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happens?
select("distinct <columns>") ignores distinct.
Expected behavior: a) throw an exception if this is not supported or b) apply the distinct.
E.g. select(count("*") throws an exception _duckdb.BinderException: Binder Error: Aggregates cannot be present in a Project relation!
To Reproduce
import duckdb
import pandas as pd
df = pd.DataFrame({"a": [1, 2, 1, 1], "b": [10, 10, 10, 20], "c": [0, 1, 2, 3]})
duckdb.execute("CREATE TABLE foo AS SELECT * FROM df")
sql_query_selectdistinct = duckdb.table("foo").select("DISTINCT a, b").sql_query()
print(sql_query_selectdistinct)
assert "SELECT DISTINCT a, b FROM main.foo" == sql_query_selectdistinct
assert duckdb.table("foo").select("a, b").distinct().sql_query() == sql_query_selectdistinct
Output:
SELECT a, b FROM main.foo
Both assertions fail
OS:
Windows 11 x86_64
DuckDB Package Version:
1.4.1
Python Version:
3.13.6
Full Name:
Clemens Korner
Affiliation:
AIT Austrian Institute of Technology
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?
- Yes, I have
Did you include all relevant configuration to reproduce the issue?
- Yes, I have
- Lenguaje dominante
- Python
- Estrellas
- 189
- Forks
- 119
- Merge medio
- 21 h 11 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de duckdb/duckdb-python
-
`overwrite` parameter in `to_parquet` does nothingPosiblemente ocupada @00200200 la tomó hace 14 días. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
duckdb/duckdb-python#633 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Type stubs omit the `connection` keyword on module-level `read_json` and `write_csv`Posiblemente ocupada @tojacob03 la tomó hace 13 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 90/100
duckdb/duckdb-python#627 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`read_json` accepts a list of paths at runtime but the type stub only allows a single path.Posiblemente ocupada @aleks-drozy la tomó hace 71 días. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
duckdb/duckdb-python#576 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
duckdb/duckdb-python#534 ·
Los mantenedores suelen responder en 1 día
-
Missing ROW_GROUPS_PER_FILE argument in write_parquet functionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoneeds triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
duckdb/duckdb-python#386 ·
Los mantenedores suelen responder en 1 día
Todos los issues de duckdb/duckdb-python
Issues similares
-
bug difficulty:2 good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
MakazhanAlpamys/Soup#1865 ·
Los mantenedores suelen responder en 1 día
-
area: agents area: docs good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
openapi/gknowledge#23 ·
-
useless-suppression reported for deprecated-* messages that should be exemptPosiblemente ocupada @adityasinha-ghub la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
pylint-dev/pylint#11656 ·
Los mantenedores suelen responder en 1 día
-
area:provisioning effort:S priority:P2 provider:local-libvirt risk:daytime-only status:in-progress type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
randomparity/kdive#3203 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
get() for StrEnumPosiblemente ocupada @FeJo5952 la tomó hoy. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
collective/icalendar#1921 · 1 comentario ·
Los mantenedores suelen responder en 1 día