MCPcopy Create free account
hub / github.com/apache/arrow-rs / validate_num_child_data

Method validate_num_child_data

arrow-data/src/data.rs:1255–1266  ·  view source on GitHub ↗

Returns `Err` if self.child_data does not have exactly `expected_len` elements

(&self, expected_len: usize)

Source from the content-addressed store, hash-verified

1253
1254 /// Returns `Err` if self.child_data does not have exactly `expected_len` elements
1255 fn validate_num_child_data(&self, expected_len: usize) -> Result<(), ArrowError> {
1256 if self.child_data.len() != expected_len {
1257 Err(ArrowError::InvalidArgumentError(format!(
1258 "Value data for {} should contain {} child data array(s), had {}",
1259 self.data_type,
1260 expected_len,
1261 self.child_data.len()
1262 )))
1263 } else {
1264 Ok(())
1265 }
1266 }
1267
1268 /// Ensures that `child_data[i]` has the expected type, calls
1269 /// `validate()` on it, and returns a reference to that child_data

Callers 2

validate_child_dataMethod · 0.80

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected