Skip to content

EXCLUDE clause in get_table_names() causes Binder Error: Column "x" in EXCLUDE list not found in FROM clause #9262

@code1704

Description

@code1704

What happens?

EXCLUDE clause in get_table_names() causes Binder Error: Column "x" in EXCLUDE list not found in FROM clause error but it's fine in query() mode.

To Reproduce

import pandas as pd
import duckdb

df = pd.DataFrame({'x': [1, 2], 'y': [3, 4]})
# Binder Error: Column "x" in EXCLUDE list not found in FROM clause
table_names = duckdb.get_table_names(" select * exclude (x) from df ")
print(table_names)

# but this is okay
res = duckdb.query(" select * exclude (x) from df ")
print(res)
┌───────┐
│   y   │
│ int64 │
├───────┤
│     3 │
│     4 │
└───────┘

OS:

Ubuntu 22.04.2 LTS, aarch64

DuckDB Version:

0.9.0, 0.9.1.dev157

DuckDB Client:

Python

Full Name:

Mark

Affiliation:

bq

Have you tried this on the latest main branch?

I have tested with a main build

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions