overwrite parameter to relation.write_csv and write_parquet seems to do nothing
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 186
- フォーク
- 113
- 平均マージ
- 13時間 29分
- マージ済み PR(30日)
- 17
説明
What happens?
The DuckDBPyRelation methods write_csv and write_parquet both have a parameter called overwrite: bool. Setting it to either False or True does nothing as far as I can tell; the target file is always overwritten if it exists.
I expected setting overwrite=False to raise an error if the target already exists. If it's meant to something else, can you please document what it does?
I can't find a matching parameter in duckdb COPY TO, so maybe it's meant for something else and I'm just confused.
To Reproduce
conn.sql('select * from range(10)').write_csv('/tmp/foo.csv', overwrite=False)
conn.sql('select * from range(10)').write_csv('/tmp/foo.csv', overwrite=False)
The file is overwritten two times in a row.
OS:
Linux
DuckDB Package Version:
1.4.1
Python Version:
3.12.12
Full Name:
Daniel Armak
Affiliation:
SparkBeyond
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?
Yes
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
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
レポートに示されている2つの同一のwrite_csv呼び出しを使って、DuckDBPyRelation.write_csvとwrite_parquetの問題を再現します。これらのリレーションメソッドから書き込み操作までoverwriteパラメーターを追跡し、overwrite=Falseで既存の対象を拒否すべきかどうかを判断します。両方のメソッドについてカバレッジがあり、パラメーターが期待どおりの効果を持つこと、または意図的な動作である場合にその動作が明確に文書化されていることが完了の条件です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 50/100