Browse Source

Fix some clippy warnings

tags/v0.3.0-rc
Philipp Oppermann 2 years ago
parent
commit
631019f8d3
Failed to extract signature
4 changed files with 14 additions and 14 deletions
  1. +7
    -7
      apis/python/operator/src/lib.rs
  2. +1
    -3
      examples/python-dataflow/run.rs
  3. +1
    -3
      examples/python-operator-dataflow/run.rs
  4. +5
    -1
      examples/rust-dataflow/sink/src/main.rs

+ 7
- 7
apis/python/operator/src/lib.rs View File

@@ -167,10 +167,10 @@ mod tests {
use eyre::{Context, Result};

fn assert_roundtrip(arrow_array: &ArrayData) -> Result<()> {
let size = required_data_size(&arrow_array);
let size = required_data_size(arrow_array);
let mut sample: Vec<u8> = vec![0; size];

let info = copy_array_into_sample(&mut sample, &arrow_array)?;
let info = copy_array_into_sample(&mut sample, arrow_array)?;

let serialized_deserialized_arrow_array = Arc::new(RawData::Vec(sample))
.into_arrow_array(&info)
@@ -201,11 +201,11 @@ mod tests {
let struct_array = StructArray::from(vec![
(
Arc::new(Field::new("b", DataType::Boolean, false)),
boolean.clone() as ArrayRef,
boolean as ArrayRef,
),
(
Arc::new(Field::new("c", DataType::Int32, false)),
int.clone() as ArrayRef,
int as ArrayRef,
),
])
.into();
@@ -224,10 +224,10 @@ mod tests {

// Construct a list array from the above two
let list_data_type = DataType::List(Arc::new(Field::new("item", DataType::Int32, false)));
let list_data = ArrayData::builder(list_data_type.clone())
let list_data = ArrayData::builder(list_data_type)
.len(3)
.add_buffer(value_offsets.clone())
.add_child_data(value_data.clone())
.add_buffer(value_offsets)
.add_child_data(value_data)
.build()
.unwrap();
let list_array = ListArray::from(list_data).into();


+ 1
- 3
examples/python-dataflow/run.rs View File

@@ -20,9 +20,7 @@ async fn main() -> eyre::Result<()> {
let venv = &root.join("examples").join(".env");
std::env::set_var(
"VIRTUAL_ENV",
venv.to_str()
.context("venv path not valid unicode")?
.to_owned(),
venv.to_str().context("venv path not valid unicode")?,
);
let orig_path = std::env::var("PATH")?;
let venv_bin = venv.join("bin");


+ 1
- 3
examples/python-operator-dataflow/run.rs View File

@@ -20,9 +20,7 @@ async fn main() -> eyre::Result<()> {
let venv = &root.join("examples").join(".env");
std::env::set_var(
"VIRTUAL_ENV",
venv.to_str()
.context("venv path not valid unicode")?
.to_owned(),
venv.to_str().context("venv path not valid unicode")?,
);
let orig_path = std::env::var("PATH")?;
let venv_bin = venv.join("bin");


+ 5
- 1
examples/rust-dataflow/sink/src/main.rs View File

@@ -6,7 +6,11 @@ fn main() -> eyre::Result<()> {

while let Some(event) = events.recv() {
match event {
Event::Input { id, metadata, data } => match id.as_str() {
Event::Input {
id,
metadata: _,
data,
} => match id.as_str() {
"message" => {
let received_string: &str =
TryFrom::try_from(&data).context("expected string message")?;


Loading…
Cancel
Save