Skip to content

Conversation

@amogh-jahagirdar
Copy link
Collaborator

Cleaning up some responses

@github-actions github-actions bot added the CORE label Oct 21, 2024
@amogh-jahagirdar amogh-jahagirdar changed the title Scan plan model parser only cleanup Scan plan model parser cleanup responses Oct 21, 2024
return JsonUtil.parse(json, FetchPlanningResultResponseParser::fromJson);
}

@SuppressWarnings("checkstyle:CyclomaticComplexity")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove this now

return JsonUtil.generate(gen -> toJson(response, gen), pretty);
}

@SuppressWarnings("checkstyle:CyclomaticComplexity")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be able to remove this now

public void validate() {
Preconditions.checkArgument(planStatus() != null, "Invalid status: null");
Preconditions.checkArgument(
planStatus() == PlanStatus.COMPLETED || (planTasks() == null && fileScanTasks() == null),
Copy link
Owner

@rahil-c rahil-c Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nvm I think this is working at-least from the tests standpoint

return JsonUtil.parse(json, FetchPlanningResultResponseParser::fromJson);
}

@SuppressWarnings("checkstyle:CyclomaticComplexity")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this now since we dont have so many conditionals in the method.

return JsonUtil.generate(gen -> toJson(response, gen), pretty);
}

@SuppressWarnings("checkstyle:CyclomaticComplexity")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can try also removing this here now, and see if check style passes without this.

@amogh-jahagirdar amogh-jahagirdar force-pushed the scan-plan-model-parser-only-cleanup branch from 1be1afa to 1962844 Compare October 21, 2024 17:41
planStatus() != PlanStatus.CANCELLED,
"Invalid response: 'cancelled' is not a valid status for planTableScan");
Preconditions.checkArgument(
planStatus() == PlanStatus.COMPLETED || (planTasks() == null && fileScanTasks() == null),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need one more case where if completed we must return tasks.

@rahil-c rahil-c merged commit fd70764 into rahil-c:scan-plan-model-parser-only Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants