ColumnExpression doesn't escape column name containing `.`

オープン
#46 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
python, sql
領域
backend, databases

調査の方向性

提供された Python の再現コードを duckdb.ColumnExpression と列名 b.a を使って実行し、その後 duckdb Python パッケージ内でそのエントリポイントを追跡してください。スペースを含む名前の処理と、ドットを含む名前の処理を比較してください。ドット付きの列を選択でき、b がテーブル名として扱われなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

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
import duckdb

rel = duckdb.sql("""select * from values (1, 2), (3, 4) df(a, "b.a")""")
rel.select(duckdb.ColumnExpression('b.a'))
---------------------------------------------------------------------------
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?
  • Yes, I have
Did you include all relevant configuration to reproduce the issue?
  • Yes, I have
主要言語
Python
スター
186
フォーク
113
平均マージ
20時間 58分
マージ済み PR(30日)
11

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

duckdb/duckdb-python のほかの issue

duckdb/duckdb-python の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。