Error when trying to parse multiple rows via Relational API `values`
还没有人认领这个 Issue。
评估
调研方向
首先,运行提供的 Python 复现代码并调用 conn.values(),将其多行行为与 SQL VALUES 查询进行比较。跟踪 Relational API 的 values 入口点,并确定嵌套 native 对象的解释方式。完成标准是:多行多列生成与 SQL VALUES 具有相同结果形状的标量列,并覆盖报告的案例。
由索引模型根据 Issue 内容生成。
描述
What happens?
When trying to utilize the values() function for converting a native Python object into a relation, I am unable to create a relation with multiple rows and columns.
To Reproduce
import duckdb
conn = duckdb.connect()
# 1) Base `VALUES` query using straight SQL (correct/expected)
conn.execute("FROM (VALUES (1, 'a'), (2, 'b'))").df()
# 2) 1 row, multiple columns relation (correct/expected)
conn.values([1, 'a']).df()
# 3) 2 rows, multiple columns relation (multiple different attempts - same output below)
conn.values([1, 'a'], [2, 'b']).df()
conn.values([((1), ('a')), ((2), ('b'))]).df()
conn.values(([1, 'a']), ([2, 'b'])).df()
conn.values([[1, 'a'], [2, 'b']]).df()
# 4) 2 rows, multiple columns relation (works, but typed as lists)
conn.values(([1], ['a']), ([2], ['b'])).df()
# 5) Attempted to remove the lists 🤷🏼
conn.values((1, 'a'), (2, 'b'))
Outputs:
# 1)
col0 col1
0 1 a
1 2 b
# 2)
col0 col1
0 1 a
# 3)
col0 col1
0 [1, a] [2, b]
# 4)
[1] ['a']
0 [1] [a]
1 [2] [b]
# 5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
duckdb.duckdb.BinderException: Binder Error: Referenced column "a" not found in FROM clause!
OS:
OSX 15.6
DuckDB Package Version:
1.4.0
Python Version:
3.11
Full Name:
Joe Rimsky
Affiliation:
Gecko Robotics
What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have tested with a stable release
Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set
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
- 平均合并
- 22 小时 45 分钟
- 30 天内合并 PR
- 14
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
duckdb/duckdb-python 的其他 Issue
-
needs triage
难度 2/5 1-3 小时 新手友好度 75/100
duckdb/duckdb-python#633 ·
-
难度 2/5 1-3 小时 新手友好度 90/100
duckdb/duckdb-python#627 ·
-
needs triage
难度 2/5 1-3 小时 新手友好度 78/100
duckdb/duckdb-python#576 · 3 条评论 ·
-
needs triage
难度 2/5 1-3 小时 新手友好度 76/100
duckdb/duckdb-python#534 ·
-
needs triage
难度 2/5 1-3 小时 新手友好度 68/100
duckdb/duckdb-python#386 ·
查看 duckdb/duckdb-python 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stephrobert/dsoxlab#238 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
sublimehq/package_control#1780 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 70/100
nwg-piotr/nwg-displays#145 ·