.cursor() loses schema information
- 主要言語
- Python
- スター
- 187
- フォーク
- 112
- 平均マージ
- 13時間 29分
- マージ済み PR(30日)
- 17
説明
### What happens?
Whenever .cursor is called the description says `Create a duplicate of the current connection` however it actually losses the relevant schema information and instead switches to main
### To Reproduce
```python3
con = duckdb.connect()
con.execute("CREATE SCHEMA IF NOT EXISTS other_schema")
con.execute("USE other_schema")
print(con.cursor().execute("SELECT current_schema()").fetchone())
```
### OS:
Linux x86_64
### DuckDB Package Version:
1.4.0
### Python Version:
3.11.9
### Full Name:
Julian Meyers
### Affiliation:
Independent
### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.
I have not tested with any build
### 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?
- [x] Yes, I have
### Did you include all relevant configuration to reproduce the issue?
- [x] Yes, I have
コントリビューションガイド
調査の方向性
まず、報告された Python の再現を DuckDB Python package に対して実行し、connection.cursor() の実装とテストを調べます。カーソルの作成時にアクティブなスキーマがどのように扱われるかを追跡します; con.cursor().execute("SELECT current_schema()").fetchone() が引き続き main ではなく other_schema を返せば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100