Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simlified structure patterns for irrelevant fields #487

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 20 additions & 24 deletions src/adapter/http/tests/tests/test_protocol_dataset_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ async fn test_object_url_local_fs() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
pull_strategy: messages::ObjectPullStrategy::HttpDownload,
download_from: messages::TransferUrl {
url: download_from_url,
headers: download_from_headers,
expires_at: _
..
}
} if
object_type == messages::ObjectType::DataSlice &&
Expand All @@ -133,13 +133,13 @@ async fn test_object_url_local_fs() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
pull_strategy: messages::ObjectPullStrategy::HttpDownload,
download_from: messages::TransferUrl {
url: download_from_url,
headers: download_from_headers,
expires_at: _
..
}
} if
object_type == messages::ObjectType::Checkpoint &&
Expand All @@ -158,8 +158,7 @@ async fn test_object_url_local_fs() {
messages::PushObjectTransferStrategy {
object_file: messages::ObjectFileReference {
object_type: messages::ObjectType::DataSlice,
physical_hash: _,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::SkipUpload,
upload_to: None
Expand All @@ -171,8 +170,7 @@ async fn test_object_url_local_fs() {
messages::PushObjectTransferStrategy {
object_file: messages::ObjectFileReference {
object_type: messages::ObjectType::Checkpoint,
physical_hash: _,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::SkipUpload,
upload_to: None
Expand All @@ -185,13 +183,13 @@ async fn test_object_url_local_fs() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::HttpUpload,
upload_to: Some(messages::TransferUrl {
url: upload_to_url,
headers: upload_to_headers,
expires_at: _
..
})
} if
object_type == messages::ObjectType::DataSlice &&
Expand All @@ -210,13 +208,13 @@ async fn test_object_url_local_fs() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::HttpUpload,
upload_to: Some(messages::TransferUrl {
url: upload_to_url,
headers: upload_to_headers,
expires_at: _
..
})
} if
object_type == messages::ObjectType::Checkpoint &&
Expand Down Expand Up @@ -312,13 +310,13 @@ async fn test_pull_object_url_s3() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
pull_strategy: messages::ObjectPullStrategy::HttpDownload,
download_from: messages::TransferUrl {
url: download_from_url,
headers: download_from_headers,
expires_at: _
..
}
} if
object_type == messages::ObjectType::DataSlice &&
Expand All @@ -338,13 +336,13 @@ async fn test_pull_object_url_s3() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
pull_strategy: messages::ObjectPullStrategy::HttpDownload,
download_from: messages::TransferUrl {
url: download_from_url,
headers: download_from_headers,
expires_at: _
..
}
} if
object_type == messages::ObjectType::Checkpoint &&
Expand All @@ -364,8 +362,7 @@ async fn test_pull_object_url_s3() {
messages::PushObjectTransferStrategy {
object_file: messages::ObjectFileReference {
object_type: messages::ObjectType::DataSlice,
physical_hash: _,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::SkipUpload,
upload_to: None
Expand All @@ -377,8 +374,7 @@ async fn test_pull_object_url_s3() {
messages::PushObjectTransferStrategy {
object_file: messages::ObjectFileReference {
object_type: messages::ObjectType::Checkpoint,
physical_hash: _,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::SkipUpload,
upload_to: None
Expand All @@ -391,13 +387,13 @@ async fn test_pull_object_url_s3() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::HttpUpload,
upload_to: Some(messages::TransferUrl {
url: upload_to_url,
headers: upload_to_headers,
expires_at: _
..
})
} if
object_type == messages::ObjectType::DataSlice &&
Expand All @@ -416,13 +412,13 @@ async fn test_pull_object_url_s3() {
object_file: messages::ObjectFileReference {
object_type,
physical_hash,
size: _,
..
},
push_strategy: messages::ObjectPushStrategy::HttpUpload,
upload_to: Some(messages::TransferUrl {
url: upload_to_url,
headers: upload_to_headers,
expires_at: _
..
})
} if
object_type == messages::ObjectType::Checkpoint &&
Expand Down
6 changes: 1 addition & 5 deletions src/app/cli/src/commands/ingest_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,7 @@ impl PushIngestListener for PushIngestProgress {
console::style("Dataset is up-to-date".to_owned()).yellow(),
));
}
PushIngestResult::Updated {
old_head: _,
ref new_head,
num_blocks: _,
} => {
PushIngestResult::Updated { ref new_head, .. } => {
state
.curr_progress
.finish_with_message(Self::spinner_message(
Expand Down
17 changes: 3 additions & 14 deletions src/app/cli/src/commands/log_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl AsciiRenderer {
)?;

match &block.event {
MetadataEvent::SetDataSchema(e @ SetDataSchema { schema: _ }) => {
MetadataEvent::SetDataSchema(e @ SetDataSchema { .. }) => {
let schema = e.schema_as_arrow().unwrap();
let schema_str = kamu_data_utils::schema::format::format_schema_arrow(&schema);

Expand Down Expand Up @@ -343,25 +343,14 @@ impl AsciiRenderer {
}
self.render_property(output, 0, "WebsiteURL", &e.website_url)?;
}
MetadataEvent::SetPollingSource(SetPollingSource {
fetch: _,
prepare: _,
read: _,
preprocess: _,
merge: _,
sergiimk marked this conversation as resolved.
Show resolved Hide resolved
}) => {
MetadataEvent::SetPollingSource(SetPollingSource { .. }) => {
self.render_property(output, 0, "Kind", "SetPollingSource")?;
self.render_property(output, 0, "Source", "...")?;
}
MetadataEvent::DisablePollingSource(_) => {
self.render_property(output, 0, "Kind", "DisablePollingSource")?;
}
MetadataEvent::AddPushSource(AddPushSource {
source_name,
read: _,
preprocess: _,
merge: _,
}) => {
MetadataEvent::AddPushSource(AddPushSource { source_name, .. }) => {
self.render_property(output, 0, "Kind", "AddPushSource")?;
self.render_property(output, 0, "SourceName", source_name)?;
self.render_property(output, 0, "Source", "...")?;
Expand Down
12 changes: 3 additions & 9 deletions src/app/cli/src/commands/pull_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -488,11 +488,9 @@ impl PollingIngestListener for PrettyIngestProgress {
));
}
PollingIngestResult::Updated {
old_head: _,
ref new_head,
num_blocks: _,
has_more: _,
uncacheable,
..
} => {
if *uncacheable {
state
Expand Down Expand Up @@ -637,11 +635,7 @@ impl TransformListener for PrettyTransformProgress {
TransformResult::UpToDate => {
console::style("Dataset is up-to-date".to_owned()).yellow()
}
TransformResult::Updated {
old_head: _,
ref new_head,
num_blocks: _,
} => console::style(format!(
TransformResult::Updated { ref new_head, .. } => console::style(format!(
"Committed new block {}",
new_head.as_multibase().short()
))
Expand Down Expand Up @@ -857,9 +851,9 @@ impl SyncListener for PrettySyncProgress {
let msg = match result {
SyncResult::UpToDate => console::style("Dataset is up-to-date".to_owned()).yellow(),
SyncResult::Updated {
old_head: _,
ref new_head,
num_blocks,
..
} => console::style(format!(
"Updated to {} ({} block(s))",
new_head.as_multibase().short(),
Expand Down
2 changes: 1 addition & 1 deletion src/app/cli/src/commands/push_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,9 +358,9 @@ impl SyncListener for PrettySyncProgress {
let msg = match result {
SyncResult::UpToDate => console::style("Repository is up-to-date".to_owned()).yellow(),
SyncResult::Updated {
old_head: _,
ref new_head,
num_blocks,
..
} => console::style(format!(
"Updated repository to {} ({} block(s))",
new_head.as_multibase().short(),
Expand Down
7 changes: 2 additions & 5 deletions src/app/cli/tests/tests/test_system_info_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,8 @@ async fn test_system_info() {
cargo_features: Some(_),
cargo_opt_level: Some(_),
},
workspace: WorkspaceInfo {
version: _,
root_dir: _,
},
container_runtime: ContainerRuntimeInfo { info: _ },
workspace: WorkspaceInfo { .. },
container_runtime: ContainerRuntimeInfo { .. },
}
);
}
8 changes: 2 additions & 6 deletions src/domain/core/src/services/pull_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,12 @@ pub enum PullResult {
impl From<PollingIngestResult> for PullResult {
fn from(other: PollingIngestResult) -> Self {
match other {
PollingIngestResult::UpToDate {
no_source_defined: _,
uncacheable: _,
} => PullResult::UpToDate,
PollingIngestResult::UpToDate { .. } => PullResult::UpToDate,
PollingIngestResult::Updated {
old_head,
new_head,
num_blocks,
has_more: _,
uncacheable: _,
..
} => PullResult::Updated {
old_head: Some(old_head),
new_head,
Expand Down
32 changes: 8 additions & 24 deletions src/domain/flow-system/src/entities/flow/flow_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ impl Projection for FlowState {
match (state, event) {
(None, event) => match event {
E::Initiated(FlowEventInitiated {
event_time: _,
flow_id,
flow_key,
trigger,
..
}) => Ok(Self {
flow_id,
flow_key,
Expand All @@ -95,9 +95,8 @@ impl Projection for FlowState {
match &event {
E::Initiated(_) => Err(ProjectionError::new(Some(s), event)),
E::StartConditionDefined(FlowEventStartConditionDefined {
event_time: _,
flow_id: _,
start_condition,
..
}) => {
if s.outcome.is_some() || !s.task_ids.is_empty() {
Err(ProjectionError::new(Some(s), event))
Expand All @@ -108,11 +107,7 @@ impl Projection for FlowState {
})
}
}
E::Queued(FlowEventQueued {
event_time: _,
flow_id: _,
activate_at,
}) => {
E::Queued(FlowEventQueued { activate_at, .. }) => {
if s.outcome.is_some() || !s.task_ids.is_empty() {
Err(ProjectionError::new(Some(s), event))
} else {
Expand All @@ -125,22 +120,14 @@ impl Projection for FlowState {
})
}
}
E::TriggerAdded(FlowEventTriggerAdded {
event_time: _,
flow_id: _,
trigger: _,
}) => {
E::TriggerAdded(_) => {
if s.outcome.is_some() {
Err(ProjectionError::new(Some(s), event))
} else {
Ok(s)
}
}
E::TaskScheduled(FlowEventTaskScheduled {
event_time: _,
flow_id: _,
task_id,
}) => {
E::TaskScheduled(FlowEventTaskScheduled { task_id, .. }) => {
if s.outcome.is_some() || s.timing.activate_at.is_none() {
Err(ProjectionError::new(Some(s), event))
} else {
Expand All @@ -152,8 +139,8 @@ impl Projection for FlowState {
}
E::TaskRunning(FlowEventTaskRunning {
event_time,
flow_id: _,
task_id,
..
}) => {
if s.outcome.is_some()
|| s.timing.activate_at.is_none()
Expand All @@ -172,9 +159,9 @@ impl Projection for FlowState {
}
E::TaskFinished(FlowEventTaskFinished {
event_time,
flow_id: _,
task_id,
task_outcome,
..
}) => {
if !s.task_ids.contains(task_id) || s.timing.running_since.is_none() {
Err(ProjectionError::new(Some(s), event))
Expand Down Expand Up @@ -207,10 +194,7 @@ impl Projection for FlowState {
}
}
}
E::Aborted(FlowEventAborted {
event_time,
flow_id: _,
}) => {
E::Aborted(FlowEventAborted { event_time, .. }) => {
if let Some(outcome) = s.outcome {
if outcome == FlowOutcome::Success {
Err(ProjectionError::new(Some(s), event))
Expand Down
Loading
Loading