Skip to content

Commit

Permalink
fix ordering of fields in unit tests and replace continue with todo
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-nimble committed Sep 23, 2024
1 parent 52bbdb1 commit 21ec2c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
14 changes: 7 additions & 7 deletions serde_arrow/src/internal/schema/from_samples/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,19 +949,19 @@ mod test {
name: "$".to_string(),
data_type: DataType::Struct(vec![
Field {
name: "Real::value".to_string(),
name: "Complex::i".to_string(),
data_type: DataType::Float32,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Complex::i".to_string(),
name: "Complex::j".to_string(),
data_type: DataType::Float32,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Complex::j".to_string(),
name: "Real::value".to_string(),
data_type: DataType::Float32,
nullable: true,
metadata: HashMap::new(),
Expand Down Expand Up @@ -1067,25 +1067,25 @@ mod test {
name: "$".to_string(),
data_type: DataType::Struct(vec![
Field {
name: "Something::more".to_string(),
name: "Else::another".to_string(),
data_type: DataType::UInt64,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Something::less".to_string(),
name: "Else::one".to_string(),
data_type: DataType::UInt64,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Else::one".to_string(),
name: "Something::less".to_string(),
data_type: DataType::UInt64,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Else::another".to_string(),
name: "Something::more".to_string(),
data_type: DataType::UInt64,
nullable: true,
metadata: HashMap::new(),
Expand Down
6 changes: 3 additions & 3 deletions serde_arrow/src/internal/schema/from_type/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,19 +586,19 @@ mod test {
name: "$".to_string(),
data_type: DataType::Struct(vec![
Field {
name: "Real::value".to_string(),
name: "Complex::i".to_string(),
data_type: DataType::Float32,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Complex::i".to_string(),
name: "Complex::j".to_string(),
data_type: DataType::Float32,
nullable: true,
metadata: HashMap::new(),
},
Field {
name: "Complex::j".to_string(),
name: "Real::value".to_string(),
data_type: DataType::Float32,
nullable: true,
metadata: HashMap::new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,11 @@ pub(crate) fn build_builder(path: String, field: &Field) -> Result<ArrayBuilder>

for field in children {
let Some(variant_name) = field.union_variant_name() else {
// TODO: failure message
continue;
todo!("union variant did not have a name");
};

let Some(field_name) = field.union_field_name() else {
// TODO: failure message
continue;
todo!("union field did not have a name");
};

let mut new_field = field.clone();
Expand Down

0 comments on commit 21ec2c5

Please sign in to comment.