Skip to content

Commit ae9f4d7

Browse files
author
prabhath004
committed
fix: correct type comparison for blob content_length
Azure blob content_length is u64, not Option<u64>, so compare directly with max_size cast to u64 instead of unwrapping Option.
1 parent 7cba9a4 commit ae9f4d7

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/ops/sources/azure_blob.rs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,8 @@ impl SourceExecutor for Executor {
7777

7878
// Check file size limit
7979
if let Some(max_size) = self.max_file_size {
80-
if let Some(size) = blob.properties.content_length {
81-
if size > max_size {
82-
continue;
83-
}
80+
if blob.properties.content_length > max_size as u64 {
81+
continue;
8482
}
8583
}
8684

@@ -133,14 +131,12 @@ impl SourceExecutor for Executor {
133131
.container_client(&self.container_name)
134132
.blob_client(key_str.as_ref());
135133
let properties = blob_client.get_properties().await?;
136-
if let Some(size) = properties.blob.properties.content_length {
137-
if size > max_size {
138-
return Ok(PartialSourceRowData {
139-
value: Some(SourceValue::NonExistence),
140-
ordinal: Some(Ordinal::unavailable()),
141-
content_version_fp: None,
142-
});
143-
}
134+
if properties.blob.properties.content_length > max_size as u64 {
135+
return Ok(PartialSourceRowData {
136+
value: Some(SourceValue::NonExistence),
137+
ordinal: Some(Ordinal::unavailable()),
138+
content_version_fp: None,
139+
});
144140
}
145141
}
146142

0 commit comments

Comments
 (0)