overwrite parameter to relation.write_csv and write_parquet seems to do nothing
- Vorherrschende Sprache
- Python
- Sterne
- 187
- Forks
- 112
- Ø Merge
- 13 Std. 29 Min.
- Gemergte PRs (30 T.)
- 17
Beschreibung
### 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?
- [x] Yes, I have
### Did you include all relevant configuration to reproduce the issue?
- [x] Yes, I have
Beitragsleitfaden
Rechercherichtung
Reproduziere das Problem mit DuckDBPyRelation.write_csv und write_parquet mithilfe der beiden im Bericht gezeigten identischen write_csv-Aufrufe. Verfolge den Parameter overwrite von diesen Relationsmethoden bis in den Schreibvorgang und ermittle, ob overwrite=False ein vorhandenes Ziel ablehnen sollte. Erledigt ist die Aufgabe, wenn der Parameter die erwartete Wirkung hat und für beide Methoden eine Abdeckung vorhanden ist oder wenn sein Verhalten eindeutig dokumentiert ist, falls es beabsichtigt ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- databases
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 50/100