Skip to content

Commit

Permalink
Make arrow_json::ReaderBuilder method names consistent (#4128)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold authored Apr 29, 2023
1 parent 6c3688b commit 9d72cc5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions arrow-json/src/reader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,16 @@ impl ReaderBuilder {
Self { batch_size, ..self }
}

/// Sets if the decoder should coerce primitive values (bool and number) into string when the Schema's column is Utf8 or LargeUtf8.
/// Sets if the decoder should coerce primitive values (bool and number) into string
/// when the Schema's column is Utf8 or LargeUtf8.
#[deprecated(note = "Use with_coerce_primitive")]
pub fn coerce_primitive(self, coerce_primitive: bool) -> Self {
self.with_coerce_primitive(coerce_primitive)
}

/// Sets if the decoder should coerce primitive values (bool and number) into string
/// when the Schema's column is Utf8 or LargeUtf8.
pub fn with_coerce_primitive(self, coerce_primitive: bool) -> Self {
Self {
coerce_primitive,
..self
Expand Down Expand Up @@ -669,7 +677,7 @@ mod tests {
for batch_size in [1, 3, 100, batch_size] {
unbuffered = ReaderBuilder::new(schema.clone())
.with_batch_size(batch_size)
.coerce_primitive(coerce_primitive)
.with_coerce_primitive(coerce_primitive)
.build(Cursor::new(buf.as_bytes()))
.unwrap()
.collect::<Result<Vec<_>, _>>()
Expand All @@ -683,7 +691,7 @@ mod tests {
for b in [1, 3, 5] {
let buffered = ReaderBuilder::new(schema.clone())
.with_batch_size(batch_size)
.coerce_primitive(coerce_primitive)
.with_coerce_primitive(coerce_primitive)
.build(BufReader::with_capacity(b, Cursor::new(buf.as_bytes())))
.unwrap()
.collect::<Result<Vec<_>, _>>()
Expand Down

0 comments on commit 9d72cc5

Please sign in to comment.