Skip to content

Commit

Permalink
remove failing assertion, format, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
bkietz committed Aug 28, 2024
1 parent e81e107 commit c80b399
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,17 @@ fn validate(arrow_name: &str, json_name: &str, verbose: bool) -> Result<()> {
));
}


let mut arrow_file = File::open(arrow_name)?;

arrow_file.seek(SeekFrom::Start(8))?;
let arrow_stream_reader = StreamReader::try_new(arrow_file, None)?;

if canonicalize_schema(&json_file.schema) != canonicalize_schema(&arrow_stream_reader.schema()) {
if canonicalize_schema(&json_file.schema) != canonicalize_schema(&arrow_stream_reader.schema())
{
return Err(ArrowError::ComputeError(format!(
"Schemas do not match. JSON: {:?}. Embedded stream: {:?}",
json_file.schema, arrow_stream_reader.schema()
json_file.schema,
arrow_stream_reader.schema()
)));
}

Expand Down
3 changes: 1 addition & 2 deletions arrow-ipc/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,6 @@ impl<W: Write> FileWriter<W> {

// write EOS
self.written_len += write_continuation(&mut self.writer, &self.write_options, 0)?;
assert_eq!(self.written_len % 8, 0);

let mut fbb = FlatBufferBuilder::new();
let dictionaries = fbb.create_vector(&self.dictionary_blocks);
Expand Down Expand Up @@ -1303,7 +1302,7 @@ fn write_message_at_offset<W: Write>(
writer.write_all(&PADDING[..padding_size])?;

// write arrow data
let body_len = if encoded.arrow_data.len() > 0 {
let body_len = if !encoded.arrow_data.is_empty() {
write_body_buffers(&mut writer, &encoded.arrow_data, write_options.alignment)?
} else {
0
Expand Down

0 comments on commit c80b399

Please sign in to comment.