duckdb / duckdb/duckdb-python

ColumnExpression doesn't escape column name containing `.`

Abierto
#46 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
187
Forks
112
Merge medio
13 h 29 min
PR fusionados (30 d)
17

Descripción

### What happens?

If a column name contains a `'.'` I can't select it with `duckdb.ColumnExpression`. Should `ColumnExpression` not do the escaping for us, so we can just pass the column name?

At least, that's what happens for column names that contains spaces

### To Reproduce

```python
import duckdb

rel = duckdb.sql("""select * from values (1, 2), (3, 4) df(a, "b.a")""")
rel.select(duckdb.ColumnExpression('b.a'))
```
```python-traceback
---------------------------------------------------------------------------
BinderException Traceback (most recent call last)
Cell In[3], line 1
----> 1 rel.select(duckdb.ColumnExpression('b.a'))

BinderException: Binder Error: Referenced table "b" not found!
Candidate tables: "unnamed_relation_0ba05ea8514d33bd"
```

### OS:

linux

### DuckDB Package Version:

1.3.2

### Python Version:

3.12

### Full Name:

Marco Gorelli

### Affiliation:

Quansight Labs

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a nightly build

### Did you include all relevant data sets for reproducing the issue?

No - Other reason (please specify in the issue body)

### Did you include all code required to reproduce the issue?

- [x] Yes, I have

### Did you include all relevant configuration to reproduce the issue?

- [x] Yes, I have

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.