Skip to content

Commit ae85a67

Browse files
authored
Update arrow 48.0.0 (#7854)
* Update arrow 48.0.0 * Fix for pyo3 * Update json.slt * Update pin and fix clippy * More clippy
1 parent e34dd76 commit ae85a67

File tree

14 files changed

+69
-102
lines changed

14 files changed

+69
-102
lines changed

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ rust-version = "1.70"
4848
version = "32.0.0"
4949

5050
[workspace.dependencies]
51-
arrow = { version = "47.0.0", features = ["prettyprint"] }
52-
arrow-array = { version = "47.0.0", default-features = false, features = ["chrono-tz"] }
53-
arrow-buffer = { version = "47.0.0", default-features = false }
54-
arrow-flight = { version = "47.0.0", features = ["flight-sql-experimental"] }
55-
arrow-schema = { version = "47.0.0", default-features = false }
56-
parquet = { version = "47.0.0", features = ["arrow", "async", "object_store"] }
51+
arrow = { version = "48.0.0", features = ["prettyprint"] }
52+
arrow-array = { version = "48.0.0", default-features = false, features = ["chrono-tz"] }
53+
arrow-buffer = { version = "48.0.0", default-features = false }
54+
arrow-flight = { version = "48.0.0", features = ["flight-sql-experimental"] }
55+
arrow-schema = { version = "48.0.0", default-features = false }
56+
parquet = { version = "48.0.0", features = ["arrow", "async", "object_store"] }
5757
sqlparser = { version = "0.38.0", features = ["visitor"] }
5858
chrono = { version = "0.4.31", default-features = false }
5959

datafusion-cli/Cargo.lock

Lines changed: 40 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datafusion-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ rust-version = "1.70"
2929
readme = "README.md"
3030

3131
[dependencies]
32-
arrow = "47.0.0"
32+
arrow = "48.0.0"
3333
async-trait = "0.1.41"
3434
aws-config = "0.55"
3535
aws-credential-types = "0.55"

datafusion-cli/src/print_format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ fn print_batches_with_sep(batches: &[RecordBatch], delimiter: u8) -> Result<Stri
5959
let mut bytes = vec![];
6060
{
6161
let builder = WriterBuilder::new()
62-
.has_headers(true)
62+
.with_header(true)
6363
.with_delimiter(delimiter);
6464
let mut writer = builder.build(&mut bytes);
6565
for batch in batches {

datafusion/common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ half = { version = "2.1", default-features = false }
5050
num_cpus = "1.13.0"
5151
object_store = { version = "0.7.0", default-features = false, optional = true }
5252
parquet = { workspace = true, optional = true }
53-
pyo3 = { version = "0.19.0", optional = true }
53+
pyo3 = { version = "0.20.0", optional = true }
5454
sqlparser = { workspace = true }
5555

5656
[dev-dependencies]

datafusion/common/src/file_options/csv_writer.rs

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,6 @@ pub struct CsvWriterOptions {
3737
/// Compression to apply after ArrowWriter serializes RecordBatches.
3838
/// This compression is applied by DataFusion not the ArrowWriter itself.
3939
pub compression: CompressionTypeVariant,
40-
/// Indicates whether WriterBuilder.has_header() is set to true.
41-
/// This is duplicative as WriterBuilder also stores this information.
42-
/// However, WriterBuilder does not allow public read access to the
43-
/// has_header parameter.
44-
pub has_header: bool,
45-
// TODO: expose a way to read has_header in arrow create
46-
// https://github.com/apache/arrow-rs/issues/4735
4740
}
4841

4942
impl CsvWriterOptions {
@@ -54,7 +47,6 @@ impl CsvWriterOptions {
5447
Self {
5548
writer_options,
5649
compression,
57-
has_header: true,
5850
}
5951
}
6052
}
@@ -65,29 +57,20 @@ impl TryFrom<(&ConfigOptions, &StatementOptions)> for CsvWriterOptions {
6557
fn try_from(value: (&ConfigOptions, &StatementOptions)) -> Result<Self> {
6658
let _configs = value.0;
6759
let statement_options = value.1;
68-
let mut has_header = true;
6960
let mut builder = WriterBuilder::default();
7061
let mut compression = CompressionTypeVariant::UNCOMPRESSED;
7162
for (option, value) in &statement_options.options {
7263
builder = match option.to_lowercase().as_str(){
7364
"header" => {
74-
has_header = value.parse()
65+
let has_header = value.parse()
7566
.map_err(|_| DataFusionError::Configuration(format!("Unable to parse {value} as bool as required for {option}!")))?;
76-
builder.has_headers(has_header)
67+
builder.with_header(has_header)
7768
},
7869
"date_format" => builder.with_date_format(value.to_owned()),
7970
"datetime_format" => builder.with_datetime_format(value.to_owned()),
8071
"timestamp_format" => builder.with_timestamp_format(value.to_owned()),
8172
"time_format" => builder.with_time_format(value.to_owned()),
82-
"rfc3339" => {
83-
let value_bool = value.parse()
84-
.map_err(|_| DataFusionError::Configuration(format!("Unable to parse {value} as bool as required for {option}!")))?;
85-
if value_bool{
86-
builder.with_rfc3339()
87-
} else{
88-
builder
89-
}
90-
},
73+
"rfc3339" => builder, // No-op
9174
"null_value" => builder.with_null(value.to_owned()),
9275
"compression" => {
9376
compression = CompressionTypeVariant::from_str(value.replace('\'', "").as_str())?;
@@ -112,7 +95,6 @@ impl TryFrom<(&ConfigOptions, &StatementOptions)> for CsvWriterOptions {
11295
}
11396
}
11497
Ok(CsvWriterOptions {
115-
has_header,
11698
writer_options: builder,
11799
compression,
118100
})

datafusion/common/src/file_options/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,9 @@ mod tests {
523523

524524
let csv_options = CsvWriterOptions::try_from((&config, &options))?;
525525
let builder = csv_options.writer_options;
526+
assert!(builder.header());
526527
let buff = Vec::new();
527528
let _properties = builder.build(buff);
528-
assert!(csv_options.has_header);
529529
assert_eq!(csv_options.compression, CompressionTypeVariant::GZIP);
530530
// TODO expand unit test if csv::WriterBuilder allows public read access to properties
531531

0 commit comments

Comments
 (0)