|
1 | 1 | #include "duckdb_python/nb/casters.hpp" |
2 | 2 | #include "duckdb_python/pyrelation.hpp" |
| 3 | +#include "duckdb_python/path_like.hpp" |
3 | 4 | #include "duckdb_python/pyconnection/pyconnection.hpp" |
4 | 5 | #include "duckdb_python/pytype.hpp" |
5 | 6 | #include "duckdb_python/pyresult.hpp" |
@@ -1253,12 +1254,14 @@ static Value NestedDictToStruct(const nb::object &dictionary) { |
1253 | 1254 | return Value::STRUCT(std::move(children)); |
1254 | 1255 | } |
1255 | 1256 |
|
1256 | | -void DuckDBPyRelation::ToParquet(const string &filename, const nb::object &compression, const nb::object &field_ids, |
1257 | | - const nb::object &row_group_size_bytes, const nb::object &row_group_size, |
1258 | | - const nb::object &overwrite, const nb::object &per_thread_output, |
1259 | | - const nb::object &use_tmp_file, const nb::object &partition_by, |
1260 | | - const nb::object &write_partition_columns, const nb::object &append, |
1261 | | - const nb::object &filename_pattern, const nb::object &file_size_bytes) { |
| 1257 | +void DuckDBPyRelation::ToParquet(const nb::object &file_name, const nb::object &compression, |
| 1258 | + const nb::object &field_ids, const nb::object &row_group_size_bytes, |
| 1259 | + const nb::object &row_group_size, const nb::object &overwrite, |
| 1260 | + const nb::object &per_thread_output, const nb::object &use_tmp_file, |
| 1261 | + const nb::object &partition_by, const nb::object &write_partition_columns, |
| 1262 | + const nb::object &append, const nb::object &filename_pattern, |
| 1263 | + const nb::object &file_size_bytes) { |
| 1264 | + auto filename = PathToString(file_name); |
1262 | 1265 | case_insensitive_map_t<vector<Value>> options; |
1263 | 1266 |
|
1264 | 1267 | if (!nb::none().is(compression)) { |
@@ -1371,13 +1374,14 @@ void DuckDBPyRelation::ToParquet(const string &filename, const nb::object &compr |
1371 | 1374 | PyExecuteRelation(write_parquet); |
1372 | 1375 | } |
1373 | 1376 |
|
1374 | | -void DuckDBPyRelation::ToCSV(const string &filename, const nb::object &sep, const nb::object &na_rep, |
| 1377 | +void DuckDBPyRelation::ToCSV(const nb::object &file_name, const nb::object &sep, const nb::object &na_rep, |
1375 | 1378 | const nb::object &header, const nb::object "echar, const nb::object &escapechar, |
1376 | 1379 | const nb::object &date_format, const nb::object ×tamp_format, |
1377 | 1380 | const nb::object "ing, const nb::object &encoding, const nb::object &compression, |
1378 | 1381 | const nb::object &overwrite, const nb::object &per_thread_output, |
1379 | 1382 | const nb::object &use_tmp_file, const nb::object &partition_by, |
1380 | 1383 | const nb::object &write_partition_columns) { |
| 1384 | + auto filename = PathToString(file_name); |
1381 | 1385 | case_insensitive_map_t<vector<Value>> options; |
1382 | 1386 |
|
1383 | 1387 | if (!nb::none().is(sep)) { |
|
0 commit comments