Skip to content

Fix select_dtypes for quoted column identifiers - #242

Merged
evertlammerts merged 6 commits into
duckdb:mainfrom
Schwarf:fix/select-dtypes-identifier-quoting
Jan 5, 2026
Merged

Fix select_dtypes for quoted column identifiers#242
evertlammerts merged 6 commits into
duckdb:mainfrom
Schwarf:fix/select-dtypes-identifier-quoting

Conversation

@Schwarf

Copy link
Copy Markdown
Contributor

Fixesduckdb/duckdb#20329

DuckDBPyRelation.select_dtypes failed for relations with column names that
require quoting (e.g., names containing spaces). The projection builder did
not correctly quote identifiers, leading to binder errors.

This change ensures identifiers are quoted consistently and adds a regression
test to cover the reported case.

@Schwarf
Schwarfforce-pushed the fix/select-dtypes-identifier-quoting branch from 457a873 to 75181a2CompareJanuary 1, 2026 14:17
@evertlammerts

Copy link
Copy Markdown
Member

Thanks! DuckDB has a helper you can use for this: duckdb::KeywordHelper::WriteOptionallyQuoted. Will that suffice?

@Schwarf

Copy link
Copy Markdown
ContributorAuthor

Thanks! DuckDB has a helper you can use for this: duckdb::KeywordHelper::WriteOptionallyQuoted. Will that suffice?

Thanks! I’ve switched to duckdb::KeywordHelper::WriteOptionallyQuoted as suggested and removed the custom identifier-quoting helper. The regression test continues to pass.

@evertlammerts

Copy link
Copy Markdown
Member

Perfect, thanks! I'll merge without running the tests - main is currently broken.

@evertlammerts
evertlammerts merged commit 0dd3514 into duckdb:mainJan 5, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DuckDBPyRelation.select_dtypes fails for column names containing spaces

2 participants

@Schwarf@evertlammerts