Skip to content

DuckDBPyRelation.select_dtypes fails for column names containing spaces #20329

Closed
duckdb/duckdb-python
#242

Description

@winwinashwin

What happens?

When using DuckDBPyRelation.select_dtypes() on a relation created from a pandas DataFrame, DuckDB raises a BinderException if a column name contains spaces.

This happens even though the column is correctly recognized and queryable otherwise.

To Reproduce

MRE

import pandas as pd
import duckdb
import duckdb.sqltypes as dt

df = pd.DataFrame({'na me': ['alice', 'bob']})
rel = duckdb.from_df(df)

rel.select_dtypes([dt.VARCHAR]) # ERROR

Observed Behaviour

BinderException: Binder Error: Referenced column "na" not found in FROM clause!
Candidate bindings: "na me"

OS:

Ubuntu 22.04.5 LTS on WSL2

DuckDB Version:

1.4.3

DuckDB Client:

Python

Hardware:

No response

Full Name:

Ashwin

Affiliation:

Corridor Platforms

Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

  • Yes, I have

Did you include all code required to reproduce the issue?

  • Yes, I have

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

Not applicable - the reproduction does not require a data set

Activity

  1. guillesd commented on Jan 2, 2026

    @guillesd
    Member

    @evertlammerts this one needs moving to duckdb-python. Don't have the writes to do it

  2. added a commit that references this issue on Jan 5, 2026
    0dd3514
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions